Jump to content
  • Advertisement
Sign in to follow this  
Jerry.Mouse

SlimDX Screenshot

This topic is 1546 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello, 

I have problem with SlimDX screenshot: This code 

 

 SlimDX::Direct3D9::DisplayMode displayMode = g_device3D->GetDisplayMode( 0 ); 
 SlimDX::Direct3D9::Surface^ surface = nullptr;
   
 surface = SlimDX::Direct3D9::Surface::CreateOffscreenPlain( g_device3D, 
                                                                                                  displayMode.Width, 
                                                                                                  displayMode.Height, 
                                                                                                  displayMode.Format, //  
                                                                                                  SlimDX::Direct3D9::Pool::SystemMemory );
 
   g_device3D->GetFrontBufferData( 0, surface ); // ERROR is HERE
 
   SlimDX::Direct3D9::Surface::ToFile( surface, fileName, SlimDX::Direct3D9::ImageFileFormat::Bmp );    
 
 
 
gives me Error:  D3DERR_INVALIDCALL: Invalid call (-2005530516). If I use Pool::Managed, the situation is identical. 
 
can anyone help ? 
 

 

 

 

 

 

 

all pointers (i.e. displayMode, g_device3D, surface ) are OK. If I use this code:  - a small modification - everrything is OK

 

   SlimDX::Direct3D9::DisplayMode displayMode = g_device3D->GetDisplayMode( 0 ); 
   SlimDX::Direct3D9::Surface^ surface = nullptr;
   
   surface = SlimDX::Direct3D9::Surface::CreateOffscreenPlain( g_device3D, 
                                                               displayMode.Width, 
                                                               displayMode.Height, 
                                                               displayMode.Format, //  
                                                               SlimDX::Direct3D9::Pool::SystemMemory );
 
   // g_device3D->GetFrontBufferData( 0, surface ); 
 
   surface = g_device3D->GetBackBuffer( 0, 0 ) ; //
   SlimDX::Direct3D9::Surface::ToFile( surface, fileName, SlimDX::Direct3D9::ImageFileFormat::Bmp );  
 
it is very suspicious.
Edited by Jerry.Mouse

Share this post


Link to post
Share on other sites
Advertisement

There's really not enough information here, and it looks like you're not doing any error checking either (unless, of course, you've just simplified the code for posting)...

Does CreateOffscreenPlain succeed and give you a valid pointer? Or does it generate an error?

Is g_device3D a valid pointer to an initialized D3D::Device you've created?

Share this post


Link to post
Share on other sites

all pointers (i.e. displayMode, g_device3D, surface ) are OK. If I use this code:  - a small modification - everrything is OK

 

   SlimDX::Direct3D9::DisplayMode displayMode = g_device3D->GetDisplayMode( 0 ); 
   SlimDX::Direct3D9::Surface^ surface = nullptr;
   
   surface = SlimDX::Direct3D9::Surface::CreateOffscreenPlain( g_device3D, 
                                                               displayMode.Width, 
                                                               displayMode.Height, 
                                                               displayMode.Format, //  
                                                               SlimDX::Direct3D9::Pool::SystemMemory );
 
   // g_device3D->GetFrontBufferData( 0, surface ); 
 
   surface = g_device3D->GetBackBuffer( 0, 0 ) ; //
   SlimDX::Direct3D9::Surface::ToFile( surface, fileName, SlimDX::Direct3D9::ImageFileFormat::Bmp );  
 
it is very suspicious.
 
What is (-2005530516) hexa: FFFFFFFF8876086C error ?  
Edited by Jerry.Mouse

Share this post


Link to post
Share on other sites
SlimDX::Direct3D9::DisplayMode displayMode = g_device3D->GetDisplayMode( 0 ); SlimDX::Direct3D9::Surface^ surface = nullptr; surface = SlimDX::Direct3D9::Surface::CreateOffscreenPlain( g_device3D, displayMode.Width, displayMode.Height, displayMode.Format, // SlimDX::Direct3D9::Pool::SystemMemory ); // g_device3D->GetFrontBufferData( 0, surface ); You are possible interpreted cho Minh segments of this is not, Thank many

Share this post


Link to post
Share on other sites

Im afraid, I do not understand to this sentence:

 

"You are possible interpreted cho Minh segments of this is not, Thank many...." 

 

What ? blink.png 

 

I need to get front buffer data  but I do not know how...

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!