Afficher un message
Vieux 02/10/2007, 08h55   #4
Faust
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Vous les faites avec quoi vos textes à 90° ?

réponse au titre: je fais comme ton code, à savoir création d'une
nouvelle font avec rotation, utilisation de la font...

un jour peut-être que la VCL connaitra ce paramètre (ce qui serait
plutôt bien)

/_BigGrizzly_ a couché sur son écran/ :
> J'ai cherché dans la JVCL, j'ai pas trouvé de "RotatedLabel"...


> Alors j'ai adapté un bout de code trouvé dans l'aide W32...


> procedure TFenAppMutes.PaintBox1Paint(Sender: TObject);
> var
> plf : TLogFont;
> hfnt, oldh : HFONT;
> ALV : TVersionInfo;
> AText : string;
> begin
> FillChar(plf, SizeOf(plf), 0);
> StrPCopy(plf.lfFaceName, 'Arial');
> plf.lfHeight := -MulDiv(8, GetDeviceCaps(PaintBox1.Canvas.Handle,
> LOGPIXELSY), 72);
> plf.lfWeight := FW_NORMAL;
> plf.lfEscapement := 900;
> hfnt := CreateFontIndirect(plf);
> try
> //PaintBox1.Canvas.Font.Handle := hfnt;
> oldh := SelectObject(PaintBox1.Canvas.Handle, hfnt);
> try
> ALV := TVersionInfo.Create(Application.ExeName);
> try
> AText := 'Version ' + LongVersionToString(ALV.FileLongVersion);
> PaintBox1.Canvas.TextOut(PaintBox1.Width -
> PaintBox1.Canvas.TextHeight(AText), PaintBox1.Height
> {PaintBox1.Canvas.TextWidth(AText)}, AText);
> finally
> ALV.Free;
> end;
> finally
> SelectObject(PaintBox1.Canvas.Handle, oldh);
> end;
> finally
> DeleteObject(hfnt);
> end;
> end;


--
Faust
"Une âme en peine peut en cacher une autre"


  Réponse avec citation
 
Page generated in 0,13365 seconds with 9 queries