Re: printing metafiles
- From: Rob Kennedy <me3@xxxxxxxxxxx>
- Date: Sun, 18 May 2008 23:46:22 -0500
Jamie wrote:
Mike Glazer wrote:I have the following code in Delphi where I am trying to print a metafile:
Printer.BeginDoc;
Printer.Canvas.StretchDraw(Rect(1,1,Printer.PageWidth-1,
Printer.PageHeight-1),m);
Printer.EndDoc;
But Dephi7 objects with the message
[Error] (1036): Incompatible types: 'TGraphic' and 'TMetafile'
And m is declared as a Graphics.TMetafile? And Printer is the one from the Printers unit? That error shouldn't happen. TMetafile is a direct descendant of TGraphic.
Please provide more context.
Create a Tpicture Object first..
MyPictureObject.Assign(M);
then pass the MyPictureObject instead of the M.
Then it won't even compile. TPicture is not a TGraphic, but StretchDraw requires a TGraphic.
remember to free it at some point after printing for example.
--
Rob
.
- Follow-Ups:
- Re: printing metafiles
- From: Mike Glazer
- Re: printing metafiles
- References:
- printing metafiles
- From: Mike Glazer
- Re: printing metafiles
- From: Jamie
- printing metafiles
- Prev by Date: Re: printing metafiles
- Next by Date: Linking with objects created from c code
- Previous by thread: Re: printing metafiles
- Next by thread: Re: printing metafiles
- Index(es):