Solved

WMF Image files

Posted on 2002-04-18
3
278 Views
Last Modified: 2010-04-04
I've created an application that has embedded .wmf image files.  This app works fine under Win2k.  The app also works under Win98, but the images are not visable!  What gives?

PS - I'm using Delphi 4.0
0
Comment
Question by:PaulKorzycki
  • 2
3 Comments
 
LVL 6

Accepted Solution

by:
DrDelphi earned 50 total points
ID: 6952399
From the Windows 32 API help file:

he Win32 API supports the Windows metafile format to maintain compatibility with applications written for Windows version 3.x. Following are the limitations of this format.

·     A Windows-format metafile is application and device dependent. Changes in the application's mapping modes or the device resolution affect the appearance of metafiles created in this format.
·     A Windows-format metafile does not contain a comprehensive header that describes the original picture dimensions, the resolution of the device on which the picture was created, an optional text description, or an optional palette.
·     A Windows-format metafile does not support the new curve, path, and transformation functions.

·     Some Windows-format metafile records cannot be scaled.
·     The metafile DC associated with a Windows-format metafile cannot be queried (that is, an application cannot retrieve device-resolution data, font metrics, and so on).

 

To convert a Windows-format metafile to an enhanced-format metafile, an application can call the GetMetaFileBitsEx function to retrieve the data from the Windows-format metafile and then call the SetWinMetaFileBits function to convert this data into an enhanced-format metafile.
A developer writing a Win32-based application should avoid using the Windows-format functions and use the enhanced-format functions instead.
==========================================================


Good luck!!




0
 

Author Comment

by:PaulKorzycki
ID: 6953951
I was hoping it was some simple setting I was missing.  This whole thing sounds complicated....I ended up converting the images to .BMP.  Kind of a bummer since they don't scale well.

Thanks,
P
0
 
LVL 6

Expert Comment

by:DrDelphi
ID: 6954118
You needn't do that. It is ridiculously easy to transform them in Delphi. Behold:


var newMetafile:TMetaFile;
begin
   NewMetaFile:=TmetaFile.Create;
   With NewMetaFile do
   begin
    LoadFromfile('z:\agree.wmf');
    Enhanced:=True;
    SaveToFile('z:\Agree.emf');
    Free;
   end;
end;


Good luck!!
0

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now