Board index » delphi » Stretching of a Metafile graphic

Stretching of a Metafile graphic

Hello Forum !

I like to import a external Metafile (*.emf) and need to add some grafic
objects (Text via Textout() ...). A example of Borland suggested the
following way:

  TmpMetaFile := TMetaFile.Create;
  TmpMetaFile.LoadFromFile('c:\file.emf');
  TmpCanvas := TMetaFileCanvas.Create(TmpMetaFile, 0);
  with TmpCanvas do
  try
    Draw(0,0,TmpMetaFile);
    { added grafics }
    ....

  finally
    Free;
  end;
  Pic.Canvas.Draw(0,0,TmpMetaFile);

{ Pic = TImage)

If the Metafile-Picture is bigger than the size of Pic i have problems with
this. The TImage fits the complete picture to its size (stretch = true).
This behaivor resize the added objects too.

How can I "stretch" the Metafile-Picture BEFORE i am adding my grafic
objects?

Thanks for your help !
Ralf

 

Re:Stretching of a Metafile graphic


Quote
In article <97i84h$4...@bornews.inprise.com>, Ralf Uhte wrote:
> I like to import a external Metafile (*.emf) and need to add some grafic
> objects (Text via Textout() ...). A example of Borland suggested the
> following way:
> If the Metafile-Picture is bigger than the size of Pic i have problems with
> this. The TImage fits the complete picture to its size (stretch = true).
> This behaivor resize the added objects too.
> How can I "stretch" the Metafile-Picture BEFORE i am adding my grafic
> objects?

Use StretchDraw instead of Draw when you "import" the metafile to the new
metafilecanvas. I would also create a new metafile as target for the whole
modifications, that allows you to set its size to the image size up front.

Peter Below (TeamB)  100113.1...@compuserve.com)
No e-mail responses, please, unless explicitly requested!
Note: I'm unable to visit the newsgroups every day at the moment,
so be patient if you don't get a reply immediately.

Re:Stretching of a Metafile graphic


Thank a lot Peter.
Ralf

Other Threads