PDA

View Full Version : WMF image rendering?



hcrisp
07-31-2009, 03:11 PM
Why when I save a plot to an WMF/EMF (Windows Metafile) does the shaded-surface region look blocky and slightly misaligned to the mesh grid? It looks fine if you render it in a WAVE plot, but when you save it to an EMF file the shaded surface is not accurately rendered. This is very frustrating and unprofessional when viewing the image fullscreen. How can I improve the quality of my EMF files? See code and attached file for example.



SET_PLOT, 'WMF'
DEVICE, FILE='test.emf'
xsize = 20
ysize = 15
DEVICE, XSIZE=xsize, YSIZE=ysize
DEVICE, PSEUDO_COLOR=8

LOADCT, 2
z = SHIFT(DIST(40), 20, 20)
z = EXP(-(z/10)^2)
SHADE_SURF, z, SHADE=BYTSCL(z)
SURFACE, z, XST=4, YST=4, ZST=4, /NOERASE
DEVICE, /CLOSE

OPENU, unit, 'test.emf', /GET_LUN
xsize = 20 * 1000L & ysize = 15 * 1000L
POINT_LUN, unit, 32
WRITEU, unit, xsize, ysize
CLOSE, unit
FREE_LUN, unit

hcrisp
08-05-2009, 02:43 PM
I have further investigated this and I think the PV-WAVE WMF driver needs to change.

Using the EMF format spec I was able to open my file in binary mode and adjust a few values. There are binary settings in the file for Bounds (the destination bounding rectangle in device units), and xDest / yDest (the logical x- and y-coordinates of the upper-left corner of the destination rectangle). Initially the Bounds were set as (331, 101) to (4444, 3411) and the xDest and yDest were set to 331 and 101. By fiddling with the numbers, I settled on the following adjustment: change the Bounds to (328, 112) to (4441, 3422) and change the xDest and yDest to 328 and 112. This is a delta of (-3, 12). This does not improve the resolution of the surface bitmap, but it does make it align with the meshed grid.

Unfortunately, it is a lot of pain to locate and make the correct changes to an EMF file. I'm thinking it would be better if the WMF driver could be changed to output the correct positions in the first place. I know it is the PV-WAVE code that controls this because the EMF header includes the text "PV-WAVE Metafile Output".

Does this call for a change request?

donb
08-06-2009, 02:03 PM
Hi Hcrisp,

Thanks for bringing this issue to our attention; and for your investigation thus far. We don't know at this point if a CR is in order or not. I'll have our Support team log a Ticket related to your posts and we'll investigate further.

We'll contact you directly with our determination about whether this warrants the creation of a CR.

Cheers, Don B.

mdwsegrp
08-26-2009, 08:25 AM
Interestingly, this issue does not occur for metafiles that are generated when you click on the top left of a WIN32 graphics window and select "Export Graphics." The default choice is .EMF and the graphic that is exported is rendered smoothly without the blocky artifacts...