Archived

This topic is now archived and is closed to further replies.

ptsravi

OpenGL Printing OpenGL image from Visual Basic

Recommended Posts

I have developed an application in visual basic which uses opengl to render image on the screen. I want to print the image. unfortunately available help restrict themselves to VC ++ and MFC, which I am unable to follow. Anybody out there to help me ? ravi

Share this post


Link to post
Share on other sites
use glReadPixels (set it to RGB), flip along the horizontal axis and save the buffer into a Bitmap image.

Becareful for the alignment. You can set/unset this in opengl, but you also have to watch out for the bitmap format.
From here you can print off the bitmap image (or copy it into clipboard or just save it to a file).

Basically whatever you use to save the image to the hard drive, do the same but use it to print or clipboard it.



Beer - the love catalyst
good ol'' homepage

Share this post


Link to post
Share on other sites
oh, to make it really easy, set it to RGB, BYTE and 24 bit. You can leave the alignment as two word aligned or whatever you want

This way you can just copy the image data row by row (unless you want an upside down image) into the memory for the bitmap. Give it a header then print it off from there.

I have no idea how Visual Basic works for printing, but printing a bitmap shouldn''t fail. In C/C++ (win32) you don''t need the header and stuff, but if you can write a bitmap easily, you might as well since you know it will work.

Share this post


Link to post
Share on other sites