TeeCreateMetaFile
Posted: Sat Feb 25, 2012 6:12 am
Hello
The following code excerpt worked fine in a Delphi XE in Windows 7 64 bit development environment.
procedure TDataHygiene.ExecuteHygieneReport1;
var
MetaFile1: TMetaFile; // Requires graphics unit
Rect1: TRect;
begin
ChartMoveAv := TChartMoveAv.Create(Application);
Rect1.Left := 0;
Rect1.Top := 0;
Rect1.Right := ppImage1.spWidth;
Rect1.Bottom := ppImage1.spHeight;
MetaFile1 := ChartMovAv.ChartMoveAv.Chart1.TeeCreateMetafile(True, Rect1);
ppImage1.Visible := True;
ppImage1.Clear;
ppImage1.Picture.Metafile.Assign(MetaFile1);
ChartMoveAv.Close;
end;
a)
In Dephi XE2 32 bit the first compiler error was: incompatible types: 'TRectF' and 'TRect'
I added the Types unit to the uses clause and declared - Rect1: TRectF;
b)
The next compiler error was : Incompatible types: 'Vcl.Graphics.TMetaFile and 'FMXTee.Procs.TMetafile'
Interestingly, code site states that the return of the function TeeCreateMetaFile is TMetaFile. I conceptually understand that the compiler is saying the return value is not a VCL.Graphics.TMetaFile but am at a loss as to how to resolve the issue.
TIA
John
The following code excerpt worked fine in a Delphi XE in Windows 7 64 bit development environment.
procedure TDataHygiene.ExecuteHygieneReport1;
var
MetaFile1: TMetaFile; // Requires graphics unit
Rect1: TRect;
begin
ChartMoveAv := TChartMoveAv.Create(Application);
Rect1.Left := 0;
Rect1.Top := 0;
Rect1.Right := ppImage1.spWidth;
Rect1.Bottom := ppImage1.spHeight;
MetaFile1 := ChartMovAv.ChartMoveAv.Chart1.TeeCreateMetafile(True, Rect1);
ppImage1.Visible := True;
ppImage1.Clear;
ppImage1.Picture.Metafile.Assign(MetaFile1);
ChartMoveAv.Close;
end;
a)
In Dephi XE2 32 bit the first compiler error was: incompatible types: 'TRectF' and 'TRect'
I added the Types unit to the uses clause and declared - Rect1: TRectF;
b)
The next compiler error was : Incompatible types: 'Vcl.Graphics.TMetaFile and 'FMXTee.Procs.TMetafile'
Interestingly, code site states that the return of the function TeeCreateMetaFile is TMetaFile. I conceptually understand that the compiler is saying the return value is not a VCL.Graphics.TMetaFile but am at a loss as to how to resolve the issue.
TIA
John