Jump to content

View more

Image of the Day

The night is still, but the invasion brings chaos. #screenshotsaturday #hanako #indiegame #gameart #ue4 #samurai https://t.co/cgILXuokoS
IOTD | Top Screenshots

The latest, straight to your Inbox.

Subscribe to GameDev.net Direct to receive the latest updates and exclusive content.


Sign up now

Screen capture SharpDX

4: Adsense

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.


  • You cannot reply to this topic
1 reply to this topic

#1 Fess59   Members   

102
Like
0Likes
Like

Posted 26 October 2013 - 03:13 PM


Hello!
 
There is the problem of changing the color depth when I get a shot of the screen with the SharpDX. Normally only works if the selected format A8R8G8B8, for changing the format to A1R5G5B5, comes out with a blank error message:
HRESULT: [0x8876086C], Module: [SharpDX.Direct3D9], ApiCode: [D3DERR_INVALIDCALL/InvalidCall], Message: Unknown
 
Сode C#:


 

var format = SharpDX.Direct3D9.Format.A8B8G8R8;
 
present_paramsS.Windowed = true;
present_paramsS.BackBufferFormat = format;
present_paramsS.SwapEffect = SharpDX.Direct3D9.SwapEffect.Discard;
present_paramsS.BackBufferWidth = Screen.PrimaryScreen.WorkingArea.Width;
present_paramsS.BackBufferHeight = Screen.PrimaryScreen.WorkingArea.Height;
 
dS = new SharpDX.Direct3D9.Device(new SharpDX.Direct3D9.Direct3DEx(),
0,
SharpDX.Direct3D9.DeviceType.Hardware,
IntPtr.Zero,
SharpDX.Direct3D9.CreateFlags.HardwareVertexProcessing,
present_paramsS);
 
sS = SharpDX.Direct3D9.Surface.CreateOffscreenPlain(
dS,
Screen.PrimaryScreen.Bounds.Width,
Screen.PrimaryScreen.Bounds.Height,
format,
SharpDX.Direct3D9.Pool.Scratch);
 

 
The main objective to minimize the size of the image. Are there any more settings in the initialization that can affect the volume of the resulting screen shot?



#2 Jason Z   Members   

6430
Like
0Likes
Like

Posted 27 October 2013 - 08:02 AM

I don't know about the SharpDX image exporter, but typically those type of functions don't convert the format of the texture for you.  Is it possible for you to do a compression on the image after it is saved on the CPU side?  That would allow for arbitrary format selection, plus you could take as much time as needed for the conversion if you spin off another thread to do the processing for you.






Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.