void __fastcall TForm1::StringGrid3DrawCell(TObject *Sender, int ACol, int ARow, TRect &Rect,
TGridDrawState State)
{ Graphics::TBitmap * bmp = new Graphics::TBitmap;
bmp->LoadFromFile("test2.bmp" );
// TJPEGImage * img = new TJPEGImage; //TJPEGImage * img = new TJPEGImage;
// img->LoadFromFile("Image2.jpg");
String text = StringGrid3->Cells[ACol][ARow];
if (text == "0") StringGrid1->Canvas->Brush->Color = RGB(250, 245, 135);
else if (text == "1") StringGrid3->Canvas->Brush->Color = (RGB(176, 36, 132));
else if (text == "2") StringGrid3->Canvas->Brush->Color = (RGB(180, 180, 80));
else StringGrid3->Canvas->Brush->Color = RGB(50, 50, 50);
StringGrid3->Canvas->FillRect(Rect);
// if (ACol == 0 && ARow == 0) StringGrid3->Canvas->Draw(Rect.Left, Rect.Top, img);
if (text == "0") StringGrid3->Canvas->StretchDraw(Rect, bmp);
}
void __fastcall TForm1::StringGrid2DrawCell(TObject *Sender, int ACol, int ARow, TRect &Rect,
TGridDrawState State)
{ TJPEGImage * img = new TJPEGImage; //TJPEGImage * img = new TJPEGImage; // 必須 #include <Jpeg.hpp> 切記 !
img->LoadFromFile("Image4_44.jpg");
String text = StringGrid2->Cells[ACol][ARow];
if (text == "0") StringGrid1->Canvas->Brush->Color = RGB(250, 245, 135);
else if (text == "1") StringGrid2->Canvas->Brush->Color = (RGB(176, 36, 132));
else if (text == "2") StringGrid2->Canvas->Brush->Color = (RGB(180, 180, 80));
else StringGrid2->Canvas->Brush->Color = RGB(50, 50, 50);
StringGrid2->Canvas->FillRect(Rect);
// if (ACol == 0 && ARow == 0) StringGrid2->Canvas->Draw(Rect.Left, Rect.Top, img);
if (text == "0") StringGrid2->Canvas->Draw(Rect.Left, Rect.Top, img);
}