how to render to metafile?

  • Follow


Is it possible to render OpenGL calls directly to a MS metafile?
I've found this example:  
http://www.starstonesoftware.com/OpenGL/metafile.htm
but it doesn't work: emf file is created, contains some data, but viewer  
display nothing.

I've tried differents PixelFormat settings without result.

Has anybody working example?

--
0
Reply jast 6/23/2009 12:17:58 PM

"jast" <jast0@vp.pl> wrote in message news:op.uvy8f9eqrapsnf@sjarmicki...
>
> Is it possible to render OpenGL calls directly to a MS metafile?
> I've found this example: 
> http://www.starstonesoftware.com/OpenGL/metafile.htm
> but it doesn't work: emf file is created, contains some data, but viewer 
> display nothing.
>
> I've tried differents PixelFormat settings without result.
>
> Has anybody working example?
>
> --


That, if it works at all, will only work with the Microsoft software OpenGL, 
not a truly accelerated one, sych as from nVidia or ATI.

jbw 


0
Reply jbwest 6/23/2009 4:14:45 PM


On Jun 23, 2:17=A0pm, jast <ja...@vp.pl> wrote:
> Is it possible to render OpenGL calls directly to a MS metafile?
> I've found this example: =A0http://www.starstonesoftware.com/OpenGL/metaf=
ile.htm
>
>

That article is *VERY* old - notice it refers to Windows 2000
as "Windows NT 5.0".

Maybe it's better to tell us what you're trying to do rather
than what doesn't work.


--
<\___/>
/ O O \
\_____/  FTB.

http://www.topaz3d.com/  - New 3D editor for real time simulation
0
Reply fungus 6/23/2009 6:23:22 PM

On 23-06-2009 o 20:23:22 fungus <openglMYSOCKS@artlum.com> wrote:
>
> That article is *VERY* old - notice it refers to Windows 2000
> as "Windows NT 5.0".
>
> Maybe it's better to tell us what you're trying to do rather
> than what doesn't work.
>
>
> --
> <\___/>
> / O O \
> \_____/  FTB.
>
> http://www.topaz3d.com/  - New 3D editor for real time simulation



I'm trying to render OpenGL scene to the Windows enhanced metafile, under  
MS Windows XP.
I'm trying to modify (in different ways) the RenderGL function, from  
mentioned article.
But the results still are almost nothing.
"Almost", because sometimes one can see exactly one (!) point in the upper  
left corner of the emf file view.
0
Reply jast 6/24/2009 7:09:18 AM

jast wrote:
 
> Is it possible to render OpenGL calls directly to a MS
> metafile?

A universally working one: No. Best thing you can do it render to
an offscreen buffer and blit that image to a metafile. But then
you could dump the image into a ordniary image file format
anyway.

> Has anybody working example?

I doubt so.


Wolfgang

0
Reply Wolfgang 6/24/2009 8:07:30 AM

On Jun 24, 9:09=A0am, jast <ja...@vp.pl> wrote:
>
> > Maybe it's better to tell us what you're trying to do rather
> > than what doesn't work
>
> I'm trying to render OpenGL scene to the Windows enhanced metafile, under=
 =A0
> MS Windows XP.

No, that's "what"...

The question is "why?" What are you trying to achieve?

--
<\___/>
/ O O \
\_____/  FTB.

http://www.topaz3d.com/  - New 3D editor for real time simulation
0
Reply fungus 6/24/2009 10:52:15 AM

On 24-06-2009 o 12:52:15 fungus <openglMYSOCKS@artlum.com> wrote:

>
> No, that's "what"...
>
> The question is "why?" What are you trying to achieve?
>
> --
> <\___/>
> / O O \
> \_____/  FTB.
>
> http://www.topaz3d.com/  - New 3D editor for real time simulation

Why?
To pass image from my to other Windows applications (word processors,  
reporting tools...).
Metafile is a vector graphics substitute.
0
Reply jast 6/24/2009 11:33:04 AM

On Jun 24, 1:33=A0pm, jast <ja...@vp.pl> wrote:
>
> Why?
> To pass image from my to other Windows applications (word processors, =A0
> reporting tools...). Metafile is a vector graphics substitute.

Well ....

a) I never saw any other application do that so maybe
it doesn't work very well.

b) Why not just make a bitmap?


--
<\___/>
/ O O \
\_____/  FTB.

http://www.topaz3d.com/  - New 3D editor for real time simulation
0
Reply fungus 6/24/2009 12:17:26 PM

ON 24-06-2009 o 14:17:26 fungus <openglMYSOCKS@artlum.com> wrote:


>
> b) Why not just make a bitmap?
>

Resized bitmap may look very ugly!
0
Reply jast 6/24/2009 12:50:04 PM

jast wrote:

> Resized bitmap may look very ugly!

Then you're on the wrong track with OpenGL. OpenGL is designed specifically
to generate raster images.

-- 
OpenGL tip #42:
How to exactly map texture texels to screen pixels:
<http://preview.tinyurl.com/cgndc8>
0
Reply Wolfgang 6/24/2009 7:00:46 PM

"jast" <jast0@vp.pl> wrote in message news:op.uv001gxirapsnf@sjarmicki...
> On 24-06-2009 o 12:52:15 fungus <openglMYSOCKS@artlum.com> wrote:
>
>>
>> No, that's "what"...
>>
>> The question is "why?" What are you trying to achieve?
>>
>> --
>> <\___/>
>> / O O \
>> \_____/  FTB.
>>
>> http://www.topaz3d.com/  - New 3D editor for real time simulation
>
> Why?
> To pass image from my to other Windows applications (word processors, 
> reporting tools...).
> Metafile is a vector graphics substitute.


Well, you can't capture all the capabilites of OpenGL in a metafile. Like z 
buffering! But, for simple graphics, you can do something like this;

http://www.opengl.org/resources/code/samples/mjktips/Feedback.html

But, an oversized Bitmap is a whole lot better and probably faster for any 
complex scene.

jbw


0
Reply jbwest 6/25/2009 12:57:13 AM

On Jun 24, 2:50=A0pm, jast <ja...@vp.pl> wrote:
>
> > b) Why not just make a bitmap?
>
> Resized bitmap may look very ugly!

I understand your theory but I have a lot of doubts about the
practice.

a) I've never seen an app which uses OpenGL metafiles, maybe
   there's a reason.

b) You'll be using slow software rendering with no OpenGL extensions
and interpreting a big metafile will make it even slower.

c) A high-resolution bitmap will resize and print with no problems
(digital camera owners do it all the time).


--
<\___/>
/ O O \
\_____/  FTB.

http://www.topaz3d.com/  - New 3D editor for real time simulation
0
Reply fungus 6/25/2009 9:55:41 AM

11 Replies
283 Views

(page loaded in 0.142 seconds)

Similiar Articles:


















7/21/2012 6:55:21 PM


Reply: