[Lazarus] copy from Topenglcontext
Anton Kavalenka
anton.k at tut.by
Fri Jun 13 18:49:43 CEST 2014
On 13.06.2014 15:30, Andrea Mauri wrote:
> Dear all,
>
> Is it possible to copy the content of OpenGLContext to the clipboard?
> How can be done?
>
> Andrea
>
> --
> _______________________________________________
> Lazarus mailing list
> Lazarus at lists.lazarus.freepascal.org
> http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
At least in windows:
function TGLFormA.GetGlBitmap:TBitmap;
var cDC:HDC;
bm:HBitMap;
begin
Result:=TBitmap.create;
cDC:=GetDC(glPanel.handle);
bm:=Windows.CreateCompatibleBitmap(cDC,glPanel.Width,glPanel.height);
ReleaseDc(glPanel.handle,cDC);
Result.handle:=bm;
BitBlt(Result.Canvas.handle,0,0,glPanel.Width,glPanel.height,glPanel.DC,0,0,SRCCOPY);
end;
procedure TGLFormA.CopyToClipboard;
var img:TBitmap;
begin
img:=GetGLBitmap;
try
Clipboard.Assign(img);
finally
img.Free;
end;
end;
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20140613/1a4d7b76/attachment-0003.html>
More information about the Lazarus
mailing list