Advertisement
Guest User

Untitled

a guest
Apr 30th, 2017
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.75 KB | None | 0 0
  1. void __fastcall TForm18::StringGrid1DrawCell(TObject *Sender, int ACol, int ARow,
  2.           TRect &Rect, TGridDrawState State)
  3. {
  4.     Graphics::TBitmap * Bitmap = new Graphics::TBitmap;
  5.     TJPEGImage * examp = new TJPEGImage;
  6.     examp->LoadFromFile("C:\\Users\\Admin\\Documents\\Embarcadero\\Studio\\Projects\\Курсач\\Win32\\Debug\\Folder.jpg");
  7.     Bitmap->Assign(examp);
  8.     int a = DirectoryListBox1->Count - DirectoryListBox1->ItemIndex;
  9.     for (int i = 2; i <= DirectoryListBox1->Count - DirectoryListBox1->ItemIndex; i++)
  10.     if(ARow == i && ACol == 0)
  11.     {
  12.         StringGrid1->ColWidths[ACol] = Bitmap->Width;
  13.         StringGrid1->RowHeights[ARow] = Bitmap->Height;
  14.         StringGrid1->Canvas->StretchDraw(Rect, Bitmap);
  15.     }
  16.     delete examp;
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement