Hi,
wenn die Grafik zu einer Column gehört und in einer ImageList liegt, mache ich es so:
Delphi-Quellcode:
procedure TMainForm.gvCustomDrawCell(Sender:
TcxCustomGridTableView; ACanvas: TcxCanvas; AViewInfo:
TcxGridTableDataCellViewInfo; var ADone: Boolean);
const
ImageIndent = 3;
var
AImageRect, ATextRect: TRect;
begin
ACanvas.Brush.Color := AViewInfo.Params.Color;
ACanvas.FillRect(AViewInfo.Bounds);
AImageRect := AViewInfo.ContentBounds;
AImageRect.Left := AImageRect.Left + ImageIndent;
AImageRect.Right := AImageRect.Left + ImageList.Width;
ATextRect := AViewInfo.ContentBounds;
ATextRect.Left := AImageRect.Right + ImageIndent;
ACanvas.DrawImage(ImageList, AImageRect.Left, AImageRect.Top, AViewInfo.Item.Tag);
ACanvas.DrawTexT(AViewInfo.Text, ATextRect, DT_SINGLELINE or DT_LEFT);
ADone := True;
end;
Methode OnCustomDrawCell der Column...
Cu, Frank