[Lazarus] copy from Topenglcontext

Michalis Kamburelis michalis.kambi at gmail.com
Sat Jun 14 12:13:45 CEST 2014


Andrea Mauri wrote:
> Dear all,
> 
> Is it possible to copy the content of OpenGLContext to the clipboard?
> How can be done?
> 

You could also copy the contents of OpenGL context (created by
TOpenGLContext or any other similar control) using glReadPixels, and
then convert the resulting bytes into a TBitmap instance. Then you can
copy TBitmap contents to clipboard like Anton shows, using
Clipboard.Assign (see
http://wiki.lazarus.freepascal.org/Clipboard#Load_from_clipboard ).

Using glReadPixels and then converting the result will be
cross-platform, as opposed to Anton's solution using
Windows.CreateCompatibleBitmap .

Michalis





More information about the Lazarus mailing list