forums.silverfrost.com Forum Index forums.silverfrost.com
Welcome to the Silverfrost forums
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Graphics region export

 
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> ClearWin+
View previous topic :: View next topic  
Author Message
IanLambley



Joined: 17 Dec 2006
Posts: 490
Location: Sunderland

PostPosted: Tue Dec 21, 2010 1:35 pm    Post subject: Graphics region export Reply with quote

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
View user's profile Send private message Send e-mail
JohnHorspool



Joined: 26 Sep 2005
Posts: 270
Location: Gloucestershire UK

PostPosted: Tue Dec 21, 2010 4:15 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
IanLambley



Joined: 17 Dec 2006
Posts: 490
Location: Sunderland

PostPosted: Wed Dec 22, 2010 12:18 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
JohnHorspool



Joined: 26 Sep 2005
Posts: 270
Location: Gloucestershire UK

PostPosted: Wed Dec 22, 2010 6:26 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
JohnCampbell



Joined: 16 Feb 2006
Posts: 2554
Location: Sydney

PostPosted: Wed Dec 22, 2010 10:14 pm    Post subject: Reply with quote

You may neet to select the graphics region before export_image
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> ClearWin+ All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group