Page 1 of 1

oPrn:ImportWMF()

Posted: Sun Apr 02, 2006 4:22 pm
by Davide
Antonio,

after the last modification to ImportWMF() introduced with the March build, the function works ok in XP, either with WMF or with EMF files, but in Windows 98 both the file types are loaded incorrectly.

Please have a look at the modified corel.prg sample I've sent to your private mailbox.

Thank you,
Davide.

Posted: Sun Apr 02, 2006 6:57 pm
by Antonio Linares
Davide,

In Class TPrinter Method ImportWMF() try these two possibilities:

Code: Select all

   ::SetIsoTropicMode()
   ::SetWindowExt( GetDeviceCaps( ::hDC, HORZRES ),;
                   GetDeviceCaps( ::hDC, VERTRES ) )
   ::SetViewPortExt( GetDeviceCaps( ::hDC, HORZRES ),; 
                     GetDeviceCaps( ::hDC, VERTRES ) )
or

Code: Select all

   ::SetIsoTropicMode()
   ::SetWindowExt( aData[ 1 ], aData[ 2 ] )
   ::SetViewPortExt( aData[ 1 ], aData[ 2 ] )

Posted: Sun Apr 02, 2006 7:02 pm
by Antonio Linares
Davide,

In XP if you double click on the EMF file, the XP graphics viewer reports that there is an error on the EMF file. Paint Shop Pro also refuses to open it.

Posted: Sun Apr 02, 2006 8:44 pm
by Davide
Antonio,
In XP if you double click on the EMF file, the XP graphics viewer reports that there is an error on the EMF file. Paint Shop Pro also refuses to open it.
I've seen it. I've created the EMF with OpenOffice, starting from the WMF one. In W98 they are both opened correctly with ACDSee.
Anyway, I'm particularly worried about the WMF, for backward compatibility. I'll try your suggestions and I'll let you know.

Thanks,
Davide.

Posted: Sun Apr 02, 2006 9:43 pm
by Davide
Antonio,

Code: Select all

   ::SetIsoTropicMode()
   ::SetWindowExt( GetDeviceCaps( ::hDC, HORZRES ),;
                   GetDeviceCaps( ::hDC, VERTRES ) )
   ::SetViewPortExt( GetDeviceCaps( ::hDC, HORZRES ),; 
                     GetDeviceCaps( ::hDC, VERTRES ) )
Same behaviour. Anyway, it doesn't seem related to the size of printer object because the image itself is "mixed", as you can see in the screenshot I've sent you.

Code: Select all

   ::SetIsoTropicMode()
   ::SetWindowExt( aData[ 1 ], aData[ 2 ] )
   ::SetViewPortExt( aData[ 1 ], aData[ 2 ] )
It's already implemented this way, anyway I recompiled and relinked printer.prg, but nothing changes.

It seems that I've found a strange image however, because I tried other old WMF's and they works ok in Windows98 too.
The funny thing is that this image is working ok with XP and always worked well with previous FWH and FW versions in 98 too.

Thank you,
Davide.

Posted: Sun Apr 02, 2006 10:12 pm
by Antonio Linares
Davide,

You may try to rebuild that file again to see if it gets fixed.

Posted: Mon Apr 03, 2006 11:15 am
by Davide
Antonio,
Antonio Linares wrote:You may try to rebuild that file again to see if it gets fixed.
I tried the WMF on another W98 machine. Same behaviour.
I reopened the WMF with CorelDraw (which displays it correctly) and reexported it as a WMF file. Same behaviour.
The original WMF worked well in past, and it works ok in XP even now, with FWH27-3, so I guess it may be related to the changes made in FWH to use EMF files instead of WMF. I'm going to make a test with FWH25 anyway. I'll let you know.

Thank you,
Davide.

Posted: Mon Apr 03, 2006 11:54 am
by Antonio Linares
thanks,

Posted: Mon Apr 03, 2006 12:08 pm
by Davide
Antonio,

I confirm you the original WMF works ok with FWH25 in Windows98.
The problem may be related to the WMF2EMF() function in 98.

Hi,
Davide.

Posted: Mon Apr 03, 2006 12:09 pm
by Antonio Linares
Davide,

We just use standard Win32 functions for WMF2EMF().

Posted: Mon Apr 03, 2006 2:47 pm
by Davide
Antonio,
Antonio Linares wrote:We just use standard Win32 functions for WMF2EMF().
well, I really don't know why it worked before and it does not work well now. It was only a guess/suggestion based on the tests I've made so far.

Thank you,
Davide.