Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Multimedia (https://www.delphipraxis.net/16-multimedia/)
-   -   Delphi TImage über TPaintBox (https://www.delphipraxis.net/110262-timage-ueber-tpaintbox.html)

ByStones2 15. Mär 2008 17:07


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

turboPASCAL 15. Mär 2008 18:00

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?

ByStones2 15. Mär 2008 18:18

Re: TImage über TPaintBox
 
einene schriftzug aber keinen billigen sondern was okmplizierteres ...
http://cooltext.com/Logo-Design-Chrome-One

turboPASCAL 15. Mär 2008 18:54

Re: TImage über TPaintBox
 
Zitat:

keinen billigen sondern was kmplizierteres ...
JA, das kann man dan auch vom Quellcode erwarten. ;)

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:

ByStones2 16. Mär 2008 13:37

Re: TImage über TPaintBox
 
Zitat:

Zitat von turboPASCAL
Zitat:

keinen billigen sondern was kmplizierteres ...
JA, das kann man dan auch vom Quellcode erwarten. ;)

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:

hm leider war das etwas zu hoch für mich ...
hier der code
Delphi-Quellcode:
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;
das DrawDradientH hab ich hier ausm Forum:
Delphi-Quellcode:
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;
Ich hoffe das hilft euch um mir weiter ...
ByStones


Alle Zeitangaben in WEZ +1. Es ist jetzt 04:19 Uhr.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz