Einzelnen Beitrag anzeigen

Bjoerk

Registriert seit: 28. Feb 2011
Ort: Mannheim
1.384 Beiträge
 
Delphi 10.4 Sydney
 
#7

AW: Einen Ausschnitt einer Metafile in eine Metafile kopieren.

  Alt 30. Aug 2014, 13:28
Hab's hetzt doch raus. "Er" will die Metafile immer von 0/0 bis Rect.BottomRight;
Delphi-Quellcode:
procedure TMetafileExampleForm.Draw;
var
  MC: TMetafileCanvas;
begin
  FMF2.Width := FRect.Right;
  FMF2.Height := FRect.Bottom;
  PaintBox2.Width := FMF2.Width;
  PaintBox2.Height := FMF2.Height;
  MC := TMetaFileCanvas.Create(FMF2, 0);
  try
    IntersectClipRect(MC.Handle, FRect.Left, FRect.Top, FRect.Right, FRect.Bottom);
    MC.Draw(0, 0, FMF1);
  finally
    MC.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;
  Mit Zitat antworten Zitat