在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
运行效果图
procedure TfrmMain.GridDrawCell(Sender: TObject; ACol, ARow: Integer; Rect: TRect; State: TGridDrawState); var ACanvas:TCanvas; R:TRect; Bmp:TBitMap; begin ACanvas := Grid.Canvas; ACanvas.Brush.Color := clGreen; Bmp := GetPicture(ACol,ARow); if Bmp <> nil then begin R := Rect; R.Left := R.Left + 5; R.Top := R.Top + 5; R.Right := R.Right - 5; R.Bottom := R.Bottom - 5; ACanvas.StretchDraw(R,Bmp); end; end; function TfrmMain.GetPicture(ACol, ARow: Integer): TBitMap; var Index:Integer; begin Result := nil; Index := ARow * Grid.ColCount + ACol; if Index <= PicList.Count - 1 then Result := TBitMap(PicList.Items[Index]); end; procedure TfrmMain.FormCreate(Sender: TObject); var Bmp:TBitMap; Index:Integer; AFileName:string; begin PicList := TList.Create(); for Index := 1 to 18 do begin AFileName := format(ExtractFilePath(Application.ExeName) + 'Image\%d.bmp',[Index]); Bmp := TBitMap.Create(); Bmp.LoadFromFile(AFileName); PicLIst.Add(Bmp); end; end;
|
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论