下面示範 DrawGrid 填圖片 ( 其實 StringGrid 也可以 )
void __fastcall TMainForm::DrawCell(TObject *Sender, int ACol, int ARow, TRect &Rect, TGridDrawState State)
{
TDrawGrid *drawgrid = dynamic_cast<TDrawGrid *>(Sender);
Bitmap->LoadFromFile(ExtractFilePath(Application->ExeName)+__PicturePath+"123.bmp");
drawgrid->Canvas->Draw(Rect.Left, Rect.Top, Bitmap);
delete Bitmap;
}
依照圖片大小的方法
drawgrid->Canvas->StrenchDraw(TRect ,Bitmap);
參考資料
1. 我
2. https://bbs.csdn.net/topics/30220802
0 意見:
張貼留言