View previous topic :: View next topic |
Author |
Message |
IanLambley
Joined: 17 Dec 2006 Posts: 490 Location: Sunderland
|
Posted: Tue Dec 21, 2010 1:35 pm Post subject: Graphics region export |
|
|
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 |
|
Back to top |
|
|
JohnHorspool
Joined: 26 Sep 2005 Posts: 270 Location: Gloucestershire UK
|
Posted: Tue Dec 21, 2010 4:15 pm Post subject: |
|
|
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 |
|
Back to top |
|
|
IanLambley
Joined: 17 Dec 2006 Posts: 490 Location: Sunderland
|
Posted: Wed Dec 22, 2010 12:18 am Post subject: |
|
|
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 |
|
Back to top |
|
|
JohnHorspool
Joined: 26 Sep 2005 Posts: 270 Location: Gloucestershire UK
|
Posted: Wed Dec 22, 2010 6:26 pm Post subject: |
|
|
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. |
|
Back to top |
|
|
JohnCampbell
Joined: 16 Feb 2006 Posts: 2554 Location: Sydney
|
Posted: Wed Dec 22, 2010 10:14 pm Post subject: |
|
|
You may neet to select the graphics region before export_image |
|
Back to top |
|
|
|