Getting image from SKGLControl

34 views
Skip to first unread message

Peter Nelson

unread,
Oct 1, 2024, 7:13:34 PMOct 1
to skia-discuss
Hello all,

This might be a dumb question, but I can't figure out how to get an image from what is currently displayed in an SKGLControl. An SKPaintGLSurfaceEventArgs parameter is passed to the PaintSurface event handler which contains a reference to a Surface object that is used to draw the image displayed in the SKGLControl, but outside of the PaintSurface event handler, I can't figure out how to get the surface to take a snapshot of it and get the displayed image. The control exposes the DrawToBitmap method, but it returns an empty bitmap.

Can anyone point me to some code that gets the image displayed in the SKGLControl as a bitmap or image, or to the SKGLControl's surface? Basically, I need something that lets me get to the image currently being displayed.

Thanks!

Greg Daniel

unread,
Oct 1, 2024, 7:28:03 PMOct 1
to skia-d...@googlegroups.com
These sound like classes and APIs that are part of Skia Sharp and not pure Skia (which is what this forum is for). I would try asking in their forums as you'll have better luck getting the answers you need.

--
You received this message because you are subscribed to the Google Groups "skia-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to skia-discuss...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/skia-discuss/865bca3f-5789-44e9-b8da-6877bcb35e30n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages