Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Sonstige Fragen zu Delphi (https://www.delphipraxis.net/19-sonstige-fragen-zu-delphi/)
-   -   Delphi Alle Controlumrisse auf Image malen (https://www.delphipraxis.net/36828-alle-controlumrisse-auf-image-malen.html)

Neutral General 26. Dez 2004 16:24


Alle Controlumrisse auf Image malen
 
Ich würde gerne alle Controls von einer Form auf ein Image malen.
Ich mache das so, aber das Ergebnis ist irgendwie nicht zufriedenstellend :roll:
Die Controls werden in falscher Größe und Position gemalt :gruebel:

Das ist meine Procedure mit der es nicht richtig geht :

Delphi-Quellcode:
procedure ControlsMalen;
var i : Integer;
begin
  for i := 0 to Form1.ControlCount-1 do begin
   Form2.Image1.Canvas.Brush.Color := clblack;
   Form2.Image1.Canvas.Rectangle(Form1.Controls[i].Left,Form1.Controls[i].Top,
                                 Form1.Controls[i].Width,Form1.Controls[i].Height);
  end;
end;

pirechner 26. Dez 2004 16:54

Re: Alle Controlumrisse auf Image malen
 
hi
wenn ich mich nicht vertue müsste es heißen:
Delphi-Quellcode:
Form2.Image1.Canvas.Rectangle(Form1.Controls[i].Left,Form1.Controls[i].Top,
                              Form1.Controls[i].Left+Form1.Controls[i].Width,
                             Form1.Controls[i].Top+Form1.Controls[i].Height);
ich hoffe ich konnt helfen.

Neutral General 26. Dez 2004 17:06

Re: Alle Controlumrisse auf Image malen
 
... :wall: :mrgreen:


Alle Zeitangaben in WEZ +1. Es ist jetzt 21:51 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