Metafile to HTML or JPEG Convertor

Does anyone know of a EMF to HTML or JPeg convertor?
LVL 2
CalvinDayAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
TheNeilConnect With a Mentor Commented:
You can't save it as HTML as HTML isn't an image format.

What you need to do is this:

PROCEDURE WMF2JPEG(Name_In, Name_Out : STRING);
VAR
  MetaFile   : TMetaFile;
  Test_BMP   : TBitmap;
  JPeg       : TJPEGImage;
  FileStream : TFileStream;
BEGIN
  MetaFile := TMetaFile.Create;
  MetaFile.LoadFromFile(name_in);

  Test_BMP := TBitmap.Create;
  Test_BMP.Width := 100;
  Test_BMP.Height := 100;
  Test_BMP.Canvas.StretchDraw(RECT(0, 0, Test_BMP.Width, Test_BMP.Height), MetaFile);

  JPeg := TJPEGImage.Create;
  FileStream := TFileStream.Create(name_out, fmCreate);

  JPeg.Assign(Test_BMP);
  JPeg.SaveToStream(FileStream);
  JPeg.Free;
  FileStream.Free;

  MetaFile.Free;
  Test_BMP.Free;
END;

There are probably neater and shorter ways to do this but it works.

The Neil
0
 
CalvinDayAuthor Commented:
Edited text of question.
0
 
edeyCommented:
could you not use a TPicture to load the metafile & "assign" it to a TJPEGImage?


GL
Mike
0
Take Control of Web Hosting For Your Clients

As a web developer or IT admin, successfully managing multiple client accounts can be challenging. In this webinar we will look at the tools provided by Media Temple and Plesk to make managing your clients’ hosting easier.

 
ptmcompCommented:
listening...
0
 
rwilson032697Commented:
Listening
0
 
HamidHossainCommented:
Listening
0
 
CalvinDayAuthor Commented:
>There are probably neater and shorter ways to do this but it works.

It sure does.

Thanks, Calvin
0
All Courses

From novice to tech pro — start learning today.