답변이 될지 모르겠네요.
제가 전에 어느책에선가 본것인데..
다음과 같이 했던 것으로 기억합니다.
먼저 StringGrid에 이미지를 Object로 등록...
var
Bitmap: TBitmap
begin
Bitmap := TBitmap.Create;
Bitmap.LoadFromFile('c:\bitmaps\Arrow.bmp');
StringGrid1.Objects[0, 0] := Bitmap;
end;
그리고 출력은 OnDrawCell이벤트에서...
다음과 같이
procedure TForm1.StringGrid1DrawCell(Sender: TObject; ACol, ARow: Integer
Rect: TRect; State: TGridDrawState);
var
Bit: TBitmap;
begin
Bit := TBitmap(StringGrid1.Objects[ACol, ARow]);
With StringGrid1.Canvas do
begin
Draw(Rect.Left+2, Rect.Top+2, Bit);
TextOut(Rect.Left+Bit.Width, Rect.Top+3, StringGrid1.Cells[ARow, ACol]);
end;
end;
오래전에 본것을 머리속으로만 하려니깐 좀 헤깔리네요.
혹 이것보다 더 좋은 방법이 있는지도 모르겠습니다.
음...도움이 될수 있을런지 모르겠지만 되었으면 좋겠네요.
|