1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
| if (aCol >0 ) and (aRow >= FixedRows) and (arow = aRowSurvol) then begin
{ Dessin du fond }
Canvas.StretchDraw(CellRect(ACol, ARow), Form1.Image2.Picture.Bitmap);
//Canvas.Draw(aRect.Left+((aRect.Right-aRect.Left-Form1.Image2.Picture.Bitmap.Width) div 2),
// aRect.Top+((Arect.Bottom-aRect.Top-Form1.Image2.Picture.Bitmap.Height) div 2),Form1.Image2.Picture.Bitmap);
{ Texte }
Canvas.Brush.style := bsClear; //Après l'image si usage de TextOut
//Déplacement
InflateRect(aRect, -3, 0); {Décalage abscisse du texte}
aRect.Right:= aRect.Right -3; {Nécessaire pour centrage et align. droite}
if Columns[aCol-1].Alignment <> taCenter then
DrawText(Canvas.Handle, PChar(sTmp), Length(sTmp), aRect,
DT_SINGLELINE or DT_VCENTER or DT_LEFT or DT_END_ELLIPSIS)
else
DrawText(Canvas.Handle, PChar(sTmp), Length(sTmp), aRect,
DT_SINGLELINE or DT_VCENTER or DT_CENTER or DT_END_ELLIPSIS)
//Canvas.TextStyle -> Default TextStyle of TextRect not TextOut... donc
end; |
Partager