Skip to main content
GameDev.net gamedev.net
🔒 Locked

Printing OpenGL image from Visual Basic

Started by ptsravi Jan 30, 2003 at 8:53 AM 1 replies 200+ views
Original Post
ptsravi
ptsravi
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
Dredge-Master
Dredge-Master
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
Beer - the love catalystgood ol' homepage
Dredge-Master
Dredge-Master
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.
Beer - the love catalystgood ol' homepage

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.