Contents - Index - Previous - Next


Graphic property



Applies to
TProfGridCell class

Declaration
property Graphic: TGraphic;

Description

Specifies a graphic image for the cell. The graphic can be TBitmap, TIcon, TMetafile, or TJPEGImage.

Tips

1. If you wish to remove a graphic from a cell, assign nil to the cell's Graphic property.

2. If you wish to achieve transparent painting of bitmaps, set the TBitmap.Transparent property to True prior to assigning a TBitmap object to the cell's Graphic property.

3. If you wish to draw images stretched (so that they exactly fit the bounds of the cells), include the pgoStretchImages option in the Options property of the grid.


Run-time only


Example

procedure TForm1.ToolButton1Click(Sender: TObject);
var
  B: TBitmap;
begin
  B := TBitmap.Create;
  try
    B.LoadFromFile('c:\mybitmap.bmp');
    ProfGrid1.Cells[1,1].Graphic := B
  finally
    B.Free
  end
end;