Registriert seit: 10. Jun 2002
Ort: Unterhaching
11.412 Beiträge
Delphi 12 Athens
|
20. Mai 2003, 16:20
Hier ein Anfang. Einfach mal testen.
Delphi-Quellcode:
var
OldFontHandle: THandle;
LogFont: TLogFont;
FinalRect: TRect;
Txt: String;
begin
Txt := 'Sample';
with PaintBox1 do
begin
SetGraphicsMode(Canvas.Handle, GM_ADVANCED);
GetObject(Canvas.Font.Handle, SizeOf(LogFont), @LogFont);
LogFont.lfEscapement := 1800;
LogFont.lfOrientation := 0;
LogFont.lfQuality := ANTIALIASED_QUALITY;
OldFontHandle := Canvas.Font.Handle;
Canvas.Font.Handle := CreateFontIndirect(LogFont);
try
FinalRect := Rect(50, 50, Width, Height);
Windows.DrawText(Canvas.Handle, @Txt[1], Length(Txt), FinalRect,
DT_EXTERNALLEADING + DT_NOPREFIX + DT_LEFT + DT_NOCLIP +
DT_WORDBREAK);
finally
DeleteObject(Canvas.Font.Handle);
Canvas.Font.Handle := OldFontHandle;
end;
SetTextCharacterExtra(Canvas.Handle, 0);
SetGraphicsMode(Canvas.Handle, GM_COMPATIBLE);
end;
end;
... ...
Daniel Lizbeth Ich bin nicht zurück, ich tue nur so
|
|
Zitat
|