Solved

WMF Image files

Posted on 2002-04-18
3
284 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 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.

690 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