Registriert seit: 28. Feb 2011
Ort: Mannheim
1.384 Beiträge
Delphi 10.4 Sydney
|
AW: Einen Ausschnitt einer Metafile in eine Metafile kopieren.
30. Aug 2014, 15:22
Letzte Version.
Schönes WE.
Delphi-Quellcode:
procedure TMetafileExampleForm.Draw;
var
MC: TMetafileCanvas;
Temp: TMetaFile;
begin
Temp := TMetaFile.Create;
try
Temp.Width := FRect.Right;
Temp.Height := FRect.Bottom;
MC := TMetaFileCanvas.Create(Temp, 0);
try
IntersectClipRect(MC.Handle, FRect.Left, FRect.Top, FRect.Right, FRect.Bottom);
MC.Draw(0, 0, FMF1);
finally
MC.Free;
end;
FMF2.Width := FRect.Right - FRect.Left;
FMF2.Height := FRect.Bottom - FRect.Top;
PaintBox2.Width := FMF2.Width;
PaintBox2.Height := FMF2.Height;
MC := TMetaFileCanvas.Create(FMF2, 0);
try
MC.Draw(-FRect.Left, -FRect.Top, Temp);
finally
MC.Free;
end;
finally
Temp.Free;
end;
Caption := Format('FMF2.Width %d FMF2.Height %d FRect.Width %d FRect.Height %d)',
[FMF2.Width, FMF2.Height, FRect.Right - FRect.Left, FRect.Bottom - FRect.Top]);
PaintBox2.Invalidate;
end;
|
|
Zitat
|