<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div class="moz-cite-prefix">On 13.06.2014 15:30, Andrea Mauri
wrote:<br>
</div>
<blockquote cite="mid:539AEED2.4020806@gmail.com" type="cite">Dear
all,
<br>
<br>
Is it possible to copy the content of OpenGLContext to the
clipboard?
<br>
How can be done?
<br>
<br>
Andrea
<br>
<br>
--
<br>
_______________________________________________
<br>
Lazarus mailing list
<br>
<a class="moz-txt-link-abbreviated" href="mailto:Lazarus@lists.lazarus.freepascal.org">Lazarus@lists.lazarus.freepascal.org</a>
<br>
<a class="moz-txt-link-freetext" href="http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus">http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus</a>
<br>
</blockquote>
<font face="Liberation Sans">At least in windows:<br>
<br>
function TGLFormA.GetGlBitmap:TBitmap;
<br>
var cDC:HDC;
<br>
bm:HBitMap;
<br>
begin
<br>
Result:=TBitmap.create;
<br>
<br>
cDC:=GetDC(glPanel.handle);
<br>
bm:=Windows.CreateCompatibleBitmap(cDC,glPanel.Width,glPanel.height);
<br>
ReleaseDc(glPanel.handle,cDC);
<br>
Result.handle:=bm;
<br>
<br>
BitBlt(Result.Canvas.handle,0,0,glPanel.Width,glPanel.height,glPanel.DC,0,0,SRCCOPY);
<br>
end;
<br>
<br>
procedure TGLFormA.CopyToClipboard;
<br>
var img:TBitmap;
<br>
begin
<br>
img:=GetGLBitmap;
<br>
try
<br>
Clipboard.Assign(img);
<br>
finally
<br>
img.Free;
<br>
end;
<br>
end;<br>
</font>
</body>
</html>