|
||||||||||||||||||
Add Forum to Favorites | Send Topic To a Friend | View Forum FAQ | Track this topic |
Last Thread Next Thread ![]() |
| Generating a Screenshot in DirectX 8.1 |
|
![]() Anonymous Poster |
||||
|
||||
| Has anyone tried this when running their app in windowed mode? It seems that obtaining the front buffer in windowed mode grabs the WHOLE screen (i.e windows start bar, other windows visible etc). |
||||
|
||||
![]() DrunkenHyena Member since: 1/17/2001 From: Winnipeg, Canada |
||||
|
|
||||
| G'day! The last parameter is the RECT to grab from, so if you provide your window rect, you should be fine. Stay Casual, Ken Drunke |
||||
|
||||
![]() pan narrans Staff Member since: 6/4/2002 From: Leeds, United Kingdom |
||||
|
|
||||
| Wouldn't that fail if part of the window was offscreen? ---------------------------- I HATE COLLISION DETECTION!! |
||||
|
||||
![]() Corillian Member since: 1/15/2001 From: A basement somewhere, it's dark... |
||||
|
|
||||
| That's a good question. I personally havn't tried to take any screen shots from a windowed app that was only half visible so I don't know what would happen. |
||||
|
||||
![]() pan narrans Staff Member since: 6/4/2002 From: Leeds, United Kingdom |
||||
|
|
||||
| I tried it, and it DID fail whenever the window was partly offscreen, its safer to just grab the whole screen. I dont know if this would affect whether or not you should 'watermark' the screenshot. If the shot shows other apps, including the Microsoft windows OS, would they be happy for you to watermark it with your company logo? ---------------------------- I HATE COLLISION DETECTION!! |
||||
|
||||
![]() dacris Member since: 3/17/2002 From: Canada |
||||
|
|
||||
| How do you do this in VB? |
||||
|
||||
![]() dacris Member since: 3/17/2002 From: Canada |
||||
|
|
||||
| never mind. i was using DX8.0 which didn't have that function |
||||
|
||||
![]() noVum Member since: 5/23/2002 From: Germany |
||||
|
|
||||
| What's the problem with the RECT parameter? Just clamp it to the resolution and you won't get problems with off-screen coordinates. |
||||
|
||||
![]() KalvinB Banned Member since: 5/24/2000 From: AZ, USA |
||||
|
|
||||
| How do I go about saving JPG files? A 1024x768 24 bit BMP is 2.25MB which is way too big. I tried changing save line to D3DXSaveSurfaceToFile(file_name, D3DXIFF_JPG, frontbuf, NULL, NULL) but it's failing. My program loads JPGs just fine. Ben IcarusIndie.com [ The Rabbit Hole | The Labyrinth | DevZone | Gang Wars | The Wall | Hosting ] |
||||
|
||||
![]() pan narrans Staff Member since: 6/4/2002 From: Leeds, United Kingdom |
||||
|
|
||||
| If u check the SDK i think there is no support for jpeg |
||||
|
||||
![]() KalvinB Banned Member since: 5/24/2000 From: AZ, USA |
||||
|
|
||||
| According to the SDK the save function only supports .BMP and .DDS. That makes no sense why it can load JPGs but can't save them. Oh well. Ben IcarusIndie.com [ The Rabbit Hole | The Labyrinth | DevZone | Gang Wars | The Wall | Hosting ] |
||||
|
||||
![]() Anonymous Poster |
||||
|
||||
| I think there is no need to create ftontbuffer surface. GetFrontBuffer is not a copying function. It returns a reference to the original front buffer. So beginning of the code must be this : IDirect3DSurface8* frontbuf; // this is wrong // device->CreateImageSurface(screenx,screeny,D3DFMT_A8R8G8B8,&frontbuf); HRESULT hr = device->GetFrontBuffer(frontbuf); Ofcourse I might be wrong. Please inform me xtro@gmx.com.tr |
||||
|
||||
![]() Dez Member since: 10/25/2000 |
||||
|
|
||||
| Re: Saving screenshots as JPEGs Personally, I would just save the bitmap as shown, then, behind the scenes, convert it using OpenIL to whatever format you want, then delete the original bitmap. Just to be safe, this is probably something that should be done in a part of the program which is not time-critical. (ie - at shutdown time) |
||||
|
||||
![]() Corillian Member since: 1/15/2001 From: A basement somewhere, it's dark... |
||||
|
|
||||
| The reason you create a surface before the call to GetFrontBuffer() is because GetFrontBuffer() copies the the contents of the front buffer to another surface. Therefore, if you didn't have a surface to copy to you would be in a world of hurt =). For those of you interested there is another thread in the DirectX forum that addresses the screen shots in windowed mode question. http://www.gamedev.net/community/forums/topic.asp?topic_id=102697 |
||||
|
||||
![]() gamejunkie Member since: 3/16/2002 From: USA |
||||
|
|
||||
| When I attempted to implement this I continually get an INVALID_CALL returned from the call to getFrontBuffer. |
||||
|
||||
![]() Anonymous Poster |
||||
|
||||
| Never mind. I was running in windowed mode and not taking into account my screen resolution. |
||||
|
||||
![]() gamejunkie Member since: 3/16/2002 From: USA |
||||
|
|
||||
| Never mind. I was running in windowed mode and not taking into account my screen resolution. |
||||
|
||||
All times are ET (US)![]() |
Last Thread Next Thread ![]() |
|