Autor Beitrag
matze
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 4613
Erhaltene Danke: 24

XP home, prof
Delphi 2009 Prof,
BeitragVerfasst: Sa 24.04.04 11:31 
hallo !!!

hat jemand einen eine idee, wie ich buchstaben mit einem 1 pixel breitem umlaufenden rand auf ein canvas eichnen kann ?? ich komm da irgendiw nicht drauf.

_________________
In the beginning was the word.
And the word was content-type: text/plain.
MathiasH
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 699

WinXP, Win98SE, Debian, Win95
D5 Stand, D6 Prof
BeitragVerfasst: Sa 24.04.04 18:39 
Hallo matze

gute Frage wie man das machen kann, ich würd es so machen:
jeden Buchstaben einzeln setzen und einmal fett und oder größer in Randfarbe und dann ein zweites mal normal in Schriftfarbe drüberkleben, das dürfte die einfachste Methode sein, sieht aber wohl nicht so ganz top aus...

ansonsten...
möglicherweise kann man da mit den Font Outlines was machen, dürfte aber net ganz so einfach werden...

MathiasH

_________________
"Viel von sich reden, kann auch ein Mittel sein, sich zu verbergen."
Friedrich Nietzsche
matze Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 4613
Erhaltene Danke: 24

XP home, prof
Delphi 2009 Prof,
BeitragVerfasst: So 25.04.04 09:56 
also das mit dem fett geht nicht, da da eingige buchstaben breiter werden und nicht exakt unter die normalen buchstaben passen.

_________________
In the beginning was the word.
And the word was content-type: text/plain.
maximus
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 896

Win XP, Suse 8.1
Delphi 4/7/8 alles prof
BeitragVerfasst: So 25.04.04 11:46 
Ich denke du brauchst wohl eine font-render-engine. Muss ja nicht gleich so krass sein wie die von photoShop aber IMO gibts keine standard funktionen dafür.

_________________
mfg.
mâximôv
obbschtkuche
Gast
Erhaltene Danke: 1



BeitragVerfasst: So 25.04.04 15:34 
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
 canvas.Font.Size := 100;
 canvas.Font.Name := 'Arial';
 canvas.brush.style := bsclear;

 canvas.Font.Color := clRed;
 canvas.TextOut(10,10,'asdf');

 canvas.pen.color := clwhite;
 BeginPath(Canvas.Handle);
 canvas.TextOut(10,10,'asdf');
 EndPath(Canvas.Handle);
 StrokePath(Canvas.Handle);


Das sieht aber ziemlich schlecht aus, wenn Schrift-Glättung aktiviert ist. (Und funzt auch nicht mit allen Schriftarten)
MathiasH
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 699

WinXP, Win98SE, Debian, Win95
D5 Stand, D6 Prof
BeitragVerfasst: So 25.04.04 15:42 
mm schriftglättung, eigentlich wäre sowas doch auch geeignet du erstellst auf einem Bitmap deine Font (mit textout), und setzt jeden weißen pixel der einen schwarzen Nachbarn hat auf die Randfarbe (natürlich mit scanline das Ganze) Das resultierende Bild kopierst du dann in das Zielbitmap (wenn der Texthintergrund einfarbeig ist kannst du es auch gleich auf dem Zielbitmap machen)

MathiasH

_________________
"Viel von sich reden, kann auch ein Mittel sein, sich zu verbergen."
Friedrich Nietzsche
matze Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 4613
Erhaltene Danke: 24

XP home, prof
Delphi 2009 Prof,
BeitragVerfasst: Di 27.04.04 13:46 
@obbschtkuche: dein code sieht aber bei kleinen schriften so 10 oder sogar 8 punkt so was von schelcht aus.

MathiasH: krass umständlich oder ?

_________________
In the beginning was the word.
And the word was content-type: text/plain.
obbschtkuche
Gast
Erhaltene Danke: 1



BeitragVerfasst: Di 27.04.04 13:53 
Wenn du den Rand nicht irgendwie glättest wird es eben schlecht aussehen.

Da bleibt dir nichts übrig als es "per Hand" zu machen.
iGoA
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 103

Alle Win´s
D5 Prof
BeitragVerfasst: Di 27.04.04 13:59 
Ganz easy:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
  Font.color := clWhite;
  canvas.TextOut(x+1,y,Deintext);
  canvas.TextOut(x-1,y,Deintext);
  canvas.TextOut(x,y+1,Deintext);
  canvas.TextOut(x,y-1,Deintext);
  Font.color := clBlack;
  canvas.TextOut(x,y,Deintext);


Sieht eigentlich immer ganz brauchbar aus.

_________________
"Diner for One" objektorientiert:
"The same method as last year, Ms. Sophie?" (was für´n Schwachsinn)
MathiasH
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 699

WinXP, Win98SE, Debian, Win95
D5 Stand, D6 Prof
BeitragVerfasst: Di 27.04.04 14:07 
garnet mal so blöd der junge :)

_________________
"Viel von sich reden, kann auch ein Mittel sein, sich zu verbergen."
Friedrich Nietzsche
obbschtkuche
Gast
Erhaltene Danke: 1



BeitragVerfasst: Di 27.04.04 14:40 
Auf die einfachsten Ideen kommt man nicht ;)

So sieht's komplett aus:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
canvas.brush.style := bsclear;
canvas.Font.color := clWhite;
canvas.TextOut(x+1,y,Deintext);
canvas.TextOut(x-1,y,Deintext);
canvas.TextOut(x,y+1,Deintext);
canvas.TextOut(x,y-1,Deintext);
canvas.Font.color := clBlack;
canvas.TextOut(x,y,Deintext);
matze Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 4613
Erhaltene Danke: 24

XP home, prof
Delphi 2009 Prof,
BeitragVerfasst: Di 27.04.04 17:31 
jawoll !!! danke leute !! das ist ja super !

_________________
In the beginning was the word.
And the word was content-type: text/plain.