Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2013-03

BitBlt caused SIGFPE in lclproc.pas

2 messages · 2 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

xrfang

Hi There,

Why the following code generated SIGFPE on BitBlt?

=======================================
procedure TForm1.Button1Click(Sender: TObject);
var
? png: TPortableNetworkGraphic;
? ScreenDC, ClipDC: HDC;
? r: TRect;
begin
? r := Rect(0, 0, 300, 200);
? png := TPortableNetworkGraphic.Create;
? ScreenDC := GetDC(0);
? ClipDC := CreateCompatibleDC(ScreenDC);
? BitBlt(ClipDC, 0, 0, r.Right - r.Left, r.Bottom - r.Top, ScreenDC, r.Left, r.Top, SRCCOPY);
? png.LoadFromDevice(ClipDC);
? DeleteDC(ClipDC);
? ReleaseDC(0, ScreenDC);
? png.SaveToFile('test.png');
end;
=======================================

I am on Ubuntu GTK2 and hope this code to run cross platform.

Thanks
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20130301/e7b8c51f/attachment.html>

Reply by email