AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Zurück Delphi-PRAXiS Programmierung allgemein Multimedia Firemonkey Bild Perspektivisch zeichnen
Thema durchsuchen
Ansicht
Themen-Optionen

Firemonkey Bild Perspektivisch zeichnen

Ein Thema von Peter666 · begonnen am 7. Mai 2016 · letzter Beitrag vom 9. Mai 2016
 
Peter666

Registriert seit: 11. Aug 2007
357 Beiträge
 
#1

Firemonkey Bild Perspektivisch zeichnen

  Alt 7. Mai 2016, 12:42
Hi,

ich hab mal ne Frage bezüglich folgendem Problem. Ich würde gerne ein Bild perspektivisch in ein anderes Zeichnen.

Zu dem Bild hab ich noch folgende Rahmeninformation:

untenlinks=0.186, 0.04
untenrechts=1.0, 0.0
obenlinks=0.0, 0.995
obenrechts=0.823, 0.733
bereich=0.067, 0.2275, 0.457, 0.6655

Delphi-Quellcode:
procedure TfrmPromoter.FormCreate(Sender: TObject);
var
  bottomLeft: TPointF;
  bottomRight: TPointF;
  dropZone: TRectF;
  topLeft: TPointF;
  topRight: TPointF;
  content: TSizeF;
  Poly: TPolygon;

  function RealPoint(P: TPointF): TPointF;
  var
    w, h: integer;
  begin
    w := Image1.Bitmap.Width;
    h := Image1.Bitmap.Height;
    result := PointF(w * P.x, h * (1 - P.y));
  end;

  function RealRect(R: TRectF): TRectF;
  var
    P1, P2: TPointF;
  begin
    P1 := RealPoint(PointF(R.Left, R.Top));
    P2 := RealPoint(PointF(R.Right, R.Bottom));
    result := rectf(P1.x, P1.y, P2.x, P2.y);
  end;

begin
  bottomLeft := PointF(0.186, 0.04);
  bottomRight := PointF(1.0, 0.0);
  dropZone := rectf(0.067, 0.2275, 0.457, 0.6655);
  topLeft := PointF(0.0, 0.995);
  topRight := PointF(0.823, 0.733);

  content.cx := 640;
  content.cy := 1136;

  setlength(Poly, 4);
  Poly[0] := RealPoint(topLeft);
  Poly[1] := RealPoint(topRight);
  Poly[2] := RealPoint(bottomRight);
  Poly[3] := RealPoint(bottomLeft);

  with Image1.Bitmap do
  begin
    Canvas.BeginScene;
    Canvas.Fill.Color := $FFFF0000;
    Canvas.FillPolygon(Poly, 1);

    Canvas.Fill.Color := $FFFF000FF;
    Canvas.FillRect(RealRect(dropZone), 0, 0, [], 1);
    Canvas.EndScene;
  end;
end;
und damit möchte ich ein Screenshot in das virtuelle Laptopdisplay zeichnen.

Peter
Angehängte Grafiken
Dateityp: jpg mac.jpg (59,1 KB, 20x aufgerufen)

Geändert von Peter666 ( 7. Mai 2016 um 13:18 Uhr)
  Mit Zitat antworten Zitat
 


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 08:59 Uhr.
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz