![]() |
TImage über TPaintBox
Hi,
hab ein Problem... Wie lege ich ein Image über eine PaintBox wo ein Farbverlauf von schwarz nach weß ist. Egal was ich versuche mit BringToFront oder SentToBack das Image will einfach net nach vorne... SentToBack natürlich auf die PaintBox und BringToFront auf das Image ... Ich hoffe ihr könnt mir helfen... Danke schoneinmal in Vorraus :?: :?: ByStones |
Re: TImage über TPaintBox
Nein das klappt nicht. Die PaintBox stellt sozusagen nur einen begrenzten "Malbereich"
zur verfügung. Du kannst aber dein Bitmap in die PaintBox zeichnen. Was möchtest du genau wie darstellen? |
Re: TImage über TPaintBox
einene schriftzug aber keinen billigen sondern was okmplizierteres ...
![]() |
Re: TImage über TPaintBox
Zitat:
Also eine von vielen Ideen: 1. Text auf Bitmap A malen 2. Farbverlauf (oder ein Bitmapbild) auf Bitmap B malen 3. Bitmap C mit Scanline aus Bitmap A und B erstellen wobei der Schriftzug aus Bitmap A "abgetasted" wird 4. Text noch einmal als Outlineschrift drüber malen auf C Oder mit Transparenten und/oder Masken arbeiten. Viel Spass. :mrgreen: |
Re: TImage über TPaintBox
Zitat:
hier der code
Delphi-Quellcode:
das DrawDradientH hab ich hier ausm Forum:
procedure TForm1.FormPaint(Sender: TObject);
var x:Integer; begin x:=475; with PaintBox1 do begin DrawGradientH(Canvas, $00000000, $00FFFFFF, Rect(0, 0, Width, Height)); Canvas.Pen.Color := clBlack; Canvas.MoveTo(0,31); Canvas.LineTo(481,31); Canvas.MoveTo(0,31); Canvas.LineTo(0,0); Canvas.MoveTo(x,31); Canvas.LineTo(x,0); Image2.BringToFront; PaintBox1.SendToBack; end; end;
Delphi-Quellcode:
Ich hoffe das hilft euch um mir weiter ...
procedure DrawGradientH(Canvas: TCanvas; Color1, Color2: TColor; Rect: TRect);
var X, R, G, B: Integer; begin for X := Rect.Top to Rect.Bottom do begin R := Round(GetRValue(Color1) + ((GetRValue(Color2) - GetRValue(Color1)) * X / (Rect.Bottom - Rect.Top))); G := Round(GetGValue(Color1) + ((GetGValue(Color2) - GetGValue(Color1)) * X / (Rect.Bottom - Rect.Top))); B := Round(GetBValue(Color1) + ((GetBValue(Color2) - GetBValue(Color1)) * X / (Rect.Bottom - Rect.Top))); Canvas.Pen.Color := RGB(R, G, B); Canvas.Pen.Width := 1; Canvas.Pen.Style := psInsideFrame; Canvas.MoveTo(Rect.Left, X); Canvas.LineTo(Rect.Right, X); end; end; ByStones |
Alle Zeitangaben in WEZ +1. Es ist jetzt 10:13 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