?
Moin.
Ich habe mir von http://www.torry.net/vcl/labels/3dlabels/jblabel3d.zip eine Freeware 3D Label-Komponente geladen.
http://www.torry.net/quicksearchd.php?String=Label3D&Title=Yes => "Label3D v.03.10.2001"
Diese kann auch 360° Schrift darstellen, jedoch merk ich jetzt, das wenn ich 90° einstelle, die Schrift zwar auf der Form 90° gedreht ist, aber wenn ich das Programm ausführe, dann ist der Text auch zusätzlich oben links auf dem Desktop zu sehen
Was natürlich garnicht toll ist.
Kann da jemand vielleicht helfen das rauszuoperieren? Wäre super
Hier vielleicht der relevante Quellcode, ohne sich die Komponente laden zu müssen.
procedure TLabel3D.DrawAngleText(aCanvas:TCanvas;aRect:tRect;aAngle:Integer;aTxt:String);
{==========================================================================}
{ Draw text with FontIndirect (angle -> escapement) }
{--------------------------------------------------------------------------}
var LFont : TLogFont;
hOldFont, hNewFont: HFont;
begin
CalcTextPos(aRect,aAngle,aTxt);
GetObject(aCanvas.Font.Handle,SizeOf(LFont),Addr(LFont));
LFont.lfEscapement := aAngle*10;
hNewFont := CreateFontIndirect(LFont);
hOldFont := SelectObject(aCanvas.Handle,hNewFont);
aCanvas.TextOut(aRect.Left,aRect.Top,aTxt);
hNewFont := SelectObject(aCanvas.Handle,hOldFont);
DeleteObject(hNewFont);
end;
{==========================================================================}
procedure TLabel3D.DoDrawText(var Rect: TRect; Flags: Longint);
{==========================================================================}
{ Draw the text normal or with angle and with 3D-effects }
{ }
{ 3D-effects: RZLABEL-component }
{ (c) by Ray Konopka (Raize Software Solutions, Inc.) }
{ enhanced 3D-effect (c)2001 by Jaro Benes mailto:JBenes@micrel.cz }
{--------------------------------------------------------------------------}
var Text : String;
TmpRect : TRect;
UpperColor : TColor;
LowerColor : TColor;
{$IFDEF WINDOWS}
cStr : array[0..255] of Char;
{$ENDIF}
begin
Text := Caption;
{$IFDEF WINDOWS}
StrPCopy(cStr,Text);
{$ENDIF}
if (Flags and DT_CALCRECT <> 0) and ((Text = '') or ShowAccelChar and
(Text[1] = '&') and (Text[2] = #0)) then Text := Text + ' ';
if not ShowAccelChar then Flags := Flags or DT_NOPREFIX;
{$IfDef Win32}
If FEllipsesStyle = esEnd Then Flags := Flags Or DT_END_ELLIPSIS
Else If FEllipsesStyle = esPath Then Flags := Flags Or DT_PATH_ELLIPSIS;
{$EndIf}
If FEscapement=0 Then
Case {$IfNDef Win32}FLayout{$Else}Layout{$EndIf} of
tlTop:Flags := Flags Or DT_TOP;
tlCenter:Flags := Flags Or DT_VCENTER Or DT_SINGLELINE;
tlBottom:Flags := Flags Or DT_BOTTOM Or DT_SINGLELINE;
End;
Canvas.Font := Font;
If FEscapement in [46..134] Then ;
{special manipulation with shadow position is unsupported- J.B.}
UpperColor := FColorRaise;
LowerColor := FColorRecess;
if FTextStyle <> tsNone then
begin
TmpRect := Rect;
If FTextStyle <> tsShadow Then OffsetRect(TmpRect,1,1)
Else OffsetRect(TmpRect,FShift,FShift);
Case FTextStyle of
tsRecessed: Canvas.Font.Color := UpperColor;
tsHeavyRecessed: Canvas.Font.Color := UpperColor;
tsRaised: Canvas.Font.Color := LowerColor;
tsLightRaised: Canvas.Font.Color := LowerColor;
tsShadow: Canvas.Font.Color := LowerColor;
End;
if fEscapement <> 0 then
DrawAngleText(Canvas,TmpRect,fEscapement,Text)
else
DrawText(Canvas.Handle,{$IFDEF WIN32}pChar(Text){$ELSE}cStr{$ENDIF},Length(Text),TmpRect,Flags);
if FTextStyle in [tsHeavyRecessed,tsLightRaised] then
begin
TmpRect := Rect;
OffsetRect(TmpRect,-1,-1);
Case FTextStyle of
tsHeavyRecessed: Canvas.Font.Color := LowerColor;
tsLightRaised: Canvas.Font.Color := UpperColor;
End;
if fEscapement <> 0 then
DrawAngleText(Canvas,TmpRect,fEscapement,Text)
else
DrawText(Canvas.Handle,{$IFDEF WIN32}pChar(Text){$ELSE}cStr{$ENDIF},Length(Text),TmpRect,Flags);
end
end;
Canvas.Font.Color := Font.Color;
if not Enabled then Canvas.Font.Color := clGrayText;
{main color on font is upper}
if fEscapement <> 0 then
DrawAngleText(Canvas,Rect,fEscapement,Text)
else
DrawText(Canvas.Handle,{$IFDEF WIN32}pChar(Text){$ELSE}cStr{$ENDIF},Length(Text),Rect,Flags);
end;
Würd mich freuen wenn jemand soviel Ahnung von hat und den Fehler sieht.