Silverfrost Forums

Welcome to our forums

Graphics region export

21 Dec 2010 12:35 #7267

Does the export_image@ routine work for an offscreen graphics area, and if so - how. It allows .jpg, .jpeg, .bmp & .pcx.

export_bmp@ & export_pcx@ seem as though they might do this, but export_image@ only specifies it for a %gr region.

Naturally, I want to write a jpeg not a bmp or pcx, and therefore the other routines write_graphics_to_bmp@ and ...pcx@ would also help, but jpegs don't seem to be catered for. Help

Ian

21 Dec 2010 3:15 #7268

Ian,

If you are trying to export an image from an OpenGL graphics region (%og) rather than GDI (%gr), then I do the following:-

call glReadPixels to place the OpenGL graphics into a character array

CREATE_GRAPHICS_REGION@ to create an internal (off-screen) drawing surface

DIB_BLOCK_PAINT@ to paint the contents of the character array to the off-screen drawing surface

and finally export_image@ to create the jpeg file.

cheers, John

21 Dec 2010 11:18 #7271

John, I tried using CREATE_GRAPHICS_REGION@ and then export_image@ but it still only exported the screen rather than the offscreen area - I will have to try again if you think that that approach will work. Thanks Ian

22 Dec 2010 5:26 #7275

Ian, it works for me. That's the approach I use to get a jpeg of the displayed OpenGL image. Of course I don't have any GDI (%gr) graphics displayed by the program, just the temporary off screen drawing surface used to create the jpeg.

22 Dec 2010 9:14 #7277

You may neet to select the graphics region before export_image

Please login to reply.