Board index » cppbuilder » 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,when it need to be sent to printer, the memory seems too few. So I
hope print it to a METAFile, but I donot know how to do.
Who can help me? Thanks!
 

Re:print Opengl render result into metafile


If you render your image to the WINDOWs canvas then you can do this-

TImage *AnImage = new TImage();

AnImage->Canvas->CopyRect (RenderForm->ClientRect, RenderForm->Canvas,
RenderForm->ClientRect);

AnImage->Picture->Metafile->SaveToFile ( FileName );

delete AnImage;

Hope I could help you out

Regards...

--
Frank Markus Schanzenb?cher
Programmer & Designer 4
visual and audial medias
Germany @  Individual Software GmbH
Mailto:Frank_Mar...@inso-gmbh.de

Check: http://signpro.iscool.net   for a Win32/CBuilder !Open Source!
Project

Carl She schrieb in Nachricht <81iadc$pa...@forums.borland.com>...

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,when it need to be sent to printer, the memory seems too few. So I
>hope print it to a METAFile, but I donot know how to do.
>Who can help me? Thanks!

Re:print Opengl render result into metafile


Firstly, thanks for your help.

I think it is effective to small image as less than 800*600 pixels. If image
is very large, I want to render image into metafile, which act as a HDC. the
result maybe need more than 100M RAM.
Thanks.

Quote
Frank Markus S. wrote in message <81j58o$5...@forums.borland.com>...
>If you render your image to the WINDOWs canvas then you can do this-

>TImage *AnImage = new TImage();

>AnImage->Canvas->CopyRect (RenderForm->ClientRect, RenderForm->Canvas,
>RenderForm->ClientRect);

>AnImage->Picture->Metafile->SaveToFile ( FileName );

>delete AnImage;

>Hope I could help you out

>Regards...

>--
>Frank Markus Schanzenb?cher
>Programmer & Designer 4
>visual and audial medias
>Germany @  Individual Software GmbH
>Mailto:Frank_Mar...@inso-gmbh.de

>Check: http://signpro.iscool.net   for a Win32/CBuilder !Open Source!
>Project

Re:print Opengl render result into metafile


When you write 1m*1m, do you mean 1million x 1million pixels ?!
Or, do you mean 1000x1000 pixels. In this case, it will need only 3.2MB,
even assuming 32 bits per pixel, and not 100MB.

Arvind Venkataraman

Re:print Opengl render result into metafile


Incase you use a 1440x1440 dpi printer you have aprox. 8"*1440*11"*1440 =
182476800 Pixel * 3 (24Bit) =
534600 KB = 522 MB

Quite a huge map...
--
Frank Markus Schanzenb?cher
Programmer & Designer 4
visual and audial medias
Germany @  Individual Software GmbH
Mailto:Frank_Mar...@inso-gmbh.de

Check: http://signpro.iscool.net   for a Win32/CBuilder !Open Source!
Project

Arvind Venkataraman schrieb in Nachricht
<81nn18$96...@forums.borland.com>...

Quote
>When you write 1m*1m, do you mean 1million x 1million pixels ?!
>Or, do you mean 1000x1000 pixels. In this case, it will need only 3.2MB,
>even assuming 32 bits per pixel, and not 100MB.

>Arvind Venkataraman

Re:print Opengl render result into metafile


A metafile is a list of Windows GDI drawings commands.
OpengGL cannot create metafiles as far as I know. You
can render to a window or to a bitmap and that's it.

Arnold the Aardvark
===========================
http://www.foxholly.demon.co.uk
ICQ# 30592054
Don't miss the Birmingham Circus Convention's return on 29 April 2000.

Re:print Opengl render result into metafile


Arnold the Aardvark <aardv...@foxholly.demon.co.uk>?(?) ?? ????
news:01bf3d0b$b319a480$d056989e@foxholly.demon.co.uk? ???????.
Quote
> A metafile is a list of Windows GDI drawings commands.
> OpengGL cannot create metafiles as far as I know. You
> can render to a window or to a bitmap and that's it.

> Arnold the Aardvark
> ===========================
> http://www.foxholly.demon.co.uk
> ICQ# 30592054
> Don't miss the Birmingham Circus Convention's return on 29 April 2000.

No! Windows NT can make an Enhanced Metafile containing OpenGL commnads!

Followings are from the Microsoft Platform SDK On-line Help...

Printing an OpenGL Image

You can print OpenGL images rendered in enhanced metafiles.
When you render to a printer device (HDC) it must be backed by a metafile
spooler.
..snip..snip..
Before you print an OpenGL image, you must call the StartDoc function to
complete the initialization of a printer device context (DC). After calling
StartDoc, you can create rendering contexts (HGLRC) to render to the printer
device.
..snip..snip..

Re:print Opengl render result into metafile


I read doc from MSDN about rendering to metafile. But it is too few to
implement.
who can help me?
Thanks!

Other Threads