Board index » delphi » Print OpenGl Render result into Metafile

Print OpenGl Render result into Metafile

I am tying print a OpenGL Image to Printer. Because such a image is
generally very large(1m*1m), when it is be displayed on screen, no problem
exists because it has been clamped to window region(generally 800*600pixels
or 640*480pixels), when it need to be sent to printer(generally 300~600dpi),
the memory seems too few. So I hope print it to a METAFile, but I donot know
how to do. Some info in MSDN seems too few to implement.
Who can help me? Thanks!
 

Re:Print OpenGl Render result into Metafile


Quote
>I am tying print a OpenGL Image to Printer. Because such a image is
>generally very large(1m*1m), when it is be displayed on screen, no problem
>exists because it has been clamped to window region(generally 800*600pixels
>or 640*480pixels), when it need to be sent to printer(generally
300~600dpi),
>the memory seems too few. So I hope print it to a METAFile, but I donot

know

Perhaps you should render to a bitmap instead of a window (set the
appropriate PFD flags) and print the bitmap.

Jon
http://home1.gte.net/jqjacobs/index.htm

Re:Print OpenGl Render result into Metafile


For 300dpi, 1M*1M Bitmap means that it is 40inch*40inch and equal
12000pixel*12000pixel=144000000pixels. One pixel need 3 bytes to store color
and such a image need 432000000 bytes(not include other buffer needing),
which equal 412MBytes. This image is too large so that memory is no enough.

Quote
Jon Jacobs wrote in message <82lgq3$dd...@forums.borland.com>...
>>I am tying print a OpenGL Image to Printer. Because such a image is
>>generally very large(1m*1m), when it is be displayed on screen, no problem
>>exists because it has been clamped to window region(generally
800*600pixels
>>or 640*480pixels), when it need to be sent to printer(generally
>300~600dpi),
>>the memory seems too few. So I hope print it to a METAFile, but I donot
>know

>Perhaps you should render to a bitmap instead of a window (set the
>appropriate PFD flags) and print the bitmap.

>Jon
>http://home1.gte.net/jqjacobs/index.htm

Re:Print OpenGl Render result into Metafile


Quote
Carl She wrote in message <82mvfi$r...@forums.borland.com>...
>For 300dpi, 1M*1M Bitmap means that it is 40inch*40inch and equal
>12000pixel*12000pixel=144000000pixels. One pixel need 3 bytes to store
color
>and such a image need 432000000 bytes(not include other buffer needing),
>which equal 412MBytes. This image is too large so that memory is no enough.

If the bitmap to which you would render would be sized for your screen
dimensions (say 800*600*3)=1,440,000 bytes for 24-bit color, it would be
manageable size. Then you copy to the printer canvas with the appropriate
stretch. Of course you still only have screen-level resolution rather than
the printer's 300dpi, but that is the best you can get if you render to the
screen first and transfer the image (via metafile or anything else) to the
printer.

Jon

Re:Print OpenGl Render result into Metafile


The metafile will eat up whatever space the (large) bitmap would take in any
case, due to the bitmap's realtively low "algorithmic compressibility". You
are OK for ellipses and other geometric figures, but once you add bitmaps
you get a bit knackered. Creation of very large bitmaps is generally a big
problem with various video drivers. The GDI gets a bit P'O'ed with them.
Making a whole bunch of 'mosaic' bitmaps is supposed to be a bit more
reliable though. I think Earl Glynn has got some good stuff on printing
large bitmaps.

OTS

Quote
Carl She wrote in message <82lapm$d...@forums.borland.com>...
>I am tying print a OpenGL Image to Printer. Because such a image is
>generally very large(1m*1m), when it is be displayed on screen, no problem
>exists because it has been clamped to window region(generally 800*600pixels
>or 640*480pixels), when it need to be sent to printer(generally
300~600dpi),
>the memory seems too few. So I hope print it to a METAFile, but I donot
know
>how to do. Some info in MSDN seems too few to implement.
>Who can help me? Thanks!

Other Threads