Jump to content
  • Advertisement
Sign in to follow this  
prux

Screenshot doesnt work always from a DirectDraw game

This topic is 2539 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

hey all,

im trying to create a screenshot program, it works good but with DirectDraw games, it often fails. A good result:

http://img12.imageshack.us/img12/1412/goodb.gif

and a bad:

http://img202.imageshack.us/img202/7563/badh.gif

there are missing part of this image. Sometimes only the background is seen without the landscape. The screenshot code:


dc := GetWindowDc(hWindow);
if (dc = 0) then Exit;
if lpPal = nil then
begin
GetMem(lpPal, SizeOf(TLOGPALETTE) + (255 * SizeOf(TPALETTEENTRY)));
FillChar(lpPal^, SizeOf(TLOGPALETTE) + (255 * SizeOf(TPALETTEENTRY)), #0);
lpPal^.palVersion := $300;
lpPal^.palNumEntries := GetSystemPaletteEntries(dc, 0,256, lpPal^.palPalEntry);
if (lpPal^.PalNumEntries <> 0) then
begin
bm.Palette := CreatePalette(lpPal^);
end;
end;

StretchBlt (bm.Canvas.Handle, 0,0, Bm.Width,Bm.Height, Dc, 0,0, Screen.Width,Screen.Height, SRCCOPY);

ReleaseDc (hWindow, dc);


I guess its some kind of synchronisation failing.

Share this post


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

  • Advertisement
×

Important Information

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

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!