Solved

WMF Image files

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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
oracle global variables 4 80
Installshield for Embarcadero EX 10.1 Berlin 4 74
Tidtcpserver listening on multiports? 1 45
Firemonkey Queue list 1 32
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…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…

733 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