![]() |
Koordinatensystem / Gitternetzlinien in TImage
Delphi-Quellcode:
Das Ergebnis ist
procedure TForm1.btn_DrawGridClick(Sender: TObject);
const GridSize : Integer = 20; var xSteps, ySteps, xIndex, yIndex : Integer; begin If not Image1.Picture.Bitmap.Empty Then With Image1.Picture.Bitmap Do Begin xSteps:= Width div GridSize; ySteps:= Height div GridSize; With Canvas Do Begin Pen.Width:= 1; Pen.Color:= clSilver; Pen.Style:= psSolid; For xIndex:= 0 To xSteps Do For yIndex:= 0 To ySteps Do Begin MoveTo( 0, yIndex*GridSize ); LineTo( Width, yIndex*GridSize ); MoveTo( xIndex*GridSize, 0 ); LineTo( xIndex*GridSize, Height ); End; End; End Else ShowMessage( 'Kein Bild verfügbar.' ); end; ![]() Von DrDangerous! Grüsse, Daniel :hi: Ein Verbesserungsvorschlag von CarstenB: Zitat:
|
Alle Zeitangaben in WEZ +1. Es ist jetzt 02:50 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