?
Solved

WMF Image files

Posted on 2002-04-18
3
Medium Priority
?
286 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 6

Accepted Solution

by:
DrDelphi earned 200 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
Suggested Courses
Course of the Month10 days, 10 hours left to enroll

764 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