Autor Beitrag
Maik19
Hält's aus hier
Beiträge: 3



BeitragVerfasst: Mi 04.09.02 16:27 
Das ist mein Problem. Gibts dafür Beispiele.
Klabautermann
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Veteran
Beiträge: 6366
Erhaltene Danke: 60

Windows 7, Ubuntu
Delphi 7 Prof.
BeitragVerfasst: Mi 04.09.02 17:02 
Hallo,

im Grunde must du den Text nur 2x Ausgeben. Einmal den Schatten um ein Paar Pixel versetz und einmal den eingentlichen Text. Das könnte soi aussehen:
ausblenden Quelltext
1:
2:
3:
4:
Canvas.Font.Color := clSilver;
Canvas.TextOut(10, 10, 'Hallo Welt !!!');
Canvas.Font.Color := clBlack;
Canvas.TextOut(8, 8, 'Hallo Welt !!!');


Gruß
Klabautermann

PS: Natürlich muss es Font.Color sein (änderung).


Zuletzt bearbeitet von Klabautermann am Mi 04.09.02 19:40, insgesamt 1-mal bearbeitet
Visum
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 106



BeitragVerfasst: Mi 04.09.02 18:33 
Hi,

das mit der Schrift zweimal ausgeben funktioniert nicht (zumindest nicht bei mir), da er die Schrift in einem Rechteck ausgibt und dieses Rechteck füllt. Somit würde der Schatten dann übermalt.

Ich hab es (etwas aufwendiger) so gemacht:
ausblenden Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
var schrift,schatten:tbitmap;
begin

schatten:=tbitmap.create;
with schatten do
begin
Transparent:=true;
canvas.Brush.color:=clwhite;
canvas.Rectangle(0,0,100,20);
Width:=100;
Height:=50;
Canvas.Font.Color := clblue;
Canvas.TextOut(10, 10, 'Hallo Welt !!!');
end;
form1.Canvas.Draw(10,10,Schatten);

schrift:=tbitmap.create;
with schrift do
begin
Transparent:=true;
canvas.Brush.color:=clwhite;
canvas.Rectangle(0,0,100,20);
Width:=100;
Height:=50;
Canvas.Font.Color := clblack;
Canvas.TextOut(10, 10, 'Hallo Welt !!!');
end;
form1.Canvas.Draw(8,8,Schrift);


über Sinn und Unsinn dieser Lösung bin ich mir nicht so sicher, auch sieht es leider nicht sonderlich aus.

Visum
OregonGhost
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 215



BeitragVerfasst: Mi 04.09.02 19:32 
Du musst Brush.Style auf bsNone setzen, damit der kein Rechteck dahin malt.

_________________
Oregon Ghost
---
Wenn NULL besonders groß ist, ist es fast schon wie ein bisschen eins.
b.brecht
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 81



BeitragVerfasst: Do 05.09.02 18:11 
nicht bsnone, sondern bsclear, so gehts:

ausblenden Quelltext
1:
2:
3:
4:
5:
Canvas.Font.Color := clsilver;
Canvas.TextOut(10, 10, 'Hallo Welt !!!');
Canvas.Brush.Style:=bsclear;
Canvas.Font.Color := clBlack;
Canvas.TextOut(8, 8, 'Hallo Welt !!!');
OregonGhost
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 215



BeitragVerfasst: Fr 06.09.02 10:29 
Dann halt bsClear, muss ich mit FormStyle fsNone verwechselt haben ;c) Benutze halt schon lange keinen Canvas mehr...

_________________
Oregon Ghost
---
Wenn NULL besonders groß ist, ist es fast schon wie ein bisschen eins.