Solved

WMF Image files

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

ScreenConnect 6.0 Free Trial

Explore all the enhancements in one game-changing release, ScreenConnect 6.0, based on partner feedback. New features include a redesigned UI, app configurations and chat acknowledgement to improve customer engagement!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
how to center only a line in richedit? 4 57
Delphi application Soap connection 5 104
Multi-layered image in FireMonkey 9 34
how to change, disabled button color FMX ? 1 33
Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…

777 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