After the first TBitmap.Draw operation (or CopyRect!), subsequent Draw (or CopyRect!) operations draw the old image
Original Reporter info from Mantis: sekelsenmat
-
Reporter name: Felipe Monteiro de Carvalho
Original Reporter info from Mantis: sekelsenmat
- Reporter name: Felipe Monteiro de Carvalho
Description:
procedure TForm1.FormPaint(Sender: TObject);
var
F_TreeListView: TBitmap;
begin
F_TreeListView := TBitmap.Create;
F_TreeListView.SetSize(400, 400);
F_TreeListView.Canvas.Brush.Color := clWhite;
F_TreeListView.Canvas.Brush.Style := bsSOlid;
F_TreeListView.Canvas.Rectangle(Bounds(0, 0, Width, Height));
F_TreeListView.Canvas.TextOut(10, 10, '1');
Canvas.Draw(50, 50, F_TreeListView);
F_TreeListView.Canvas.TextOut(10, 10, '6');
F_TreeListView.SaveToFile('/Users/felipe/temp/filename.png'); // This shows nr 6
Canvas.Draw(50, 50, F_TreeListView); // This draws nr 1 =(
end;
You can work around by freeing and recreating the bitmap.
This is not only for Canvas.Draw but also for CopyRect, low-level StretchDraw, etc...
very wierd!
Mantis conversion info:
- Mantis ID: 28102
- OS: Mac OS X
- OS Build: 10.10
- Platform: MacBook Retina Mac OS X 10.10
- Version: 1.5 (SVN)
- Fixed in version: 1.5 (SVN)
- Fixed in revision: 49057 (#50c0c519)