Lazarus

Programming => Graphics and Multimedia => Graphics => Topic started by: PatBayford on August 09, 2017, 11:35:33 pm

Title: TDrawGrid does not paint entire canvas
Post by: PatBayford on August 09, 2017, 11:35:33 pm
I have a converted Delhi application that uses TDrawGrid and TImageList to produce an image on a from. In  general the drawing works fine, however, if the user has to use the scrollbars, any portion of the grid outside the original boundary appears blank, including cells which were drawn correctly originally. Have I missed a significant switch somewhere, or is this a bug?
This is the cell drawing code
Code: Pascal  [Select][+][-]
  1. procedure TJigsawGameMainForm.dgGameDrawCell(Sender: TObject; aCol,
  2.   aRow: Integer; aRect: TRect; aState: TGridDrawState);
  3. var i: Integer;
  4. begin
  5.   i := Game.DrawGameCell(ACol, ARow, aRect, aState);
  6.   if (i > -1) then
  7.     Game.PieceImages.Draw(Frame1_1.dgGame.Canvas,
  8.       ACol*(Frame1_1.dgGame.DefaultColWidth),
  9.       ARow*(Frame1_1.dgGame.DefaultRowHeight),i,True)
  10.   else
  11.   with Frame1_1.dgGame.Canvas do
  12.   begin
  13.     Brush.Color := clWindow;
  14.     FillRect(aRect);
  15.   end;
  16. end;
  17.  
TinyPortal © 2005-2018