Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

jpg to wmf 1

Status
Not open for further replies.

Detective

Programmer
Mar 8, 2002
15
NL
I want to convert jpg to wmf.
Therefore I downloaded the component TJPEGImage.
Now, if I try this:
image1.picture.metafile := jpegimage1.picture.graphic;
it doesn't work.

How should I do this?
 
Try
Code:
image1.picture.metafile.Assign ( jpegimage1.picture.graphic );
I haven't actually tested this out but this is the usual way of doing this kind of thing.

Andrew
 
Greetings.
Code:
var
  AMetaFile  : TMetaFile;
  AMFCanvas  : TMetaFileCanvas;
  JPEGImage  : TJPEGImage;
begin
  // assuming that you have an image in your JPEGImage
  AMetaFile := TMetaFile.Create;
  AMFCanvas := TMetaFileCanvas.Create(AMetaFile, GetDC(Self.Handle));
  AMFCanvas.StretchDraw(Rect(0, 0, 1900, 1468), Photo);
  AMFCanvas.Free;
  // note that image is copied ONLY when you free Metafile canvas.
--- markus
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top