View Issue Details

IDProjectCategoryView StatusLast Update
0028102LazarusLCLpublic2017-12-14 07:42
ReporterFelipe Monteiro de CarvalhoAssigned ToFelipe Monteiro de Carvalho 
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
PlatformMacBook Retina Mac OS X 10.10OSMac OS XOS Version10.10
Product Version1.5 (SVN)Product Build 
Target VersionFixed in Version1.5 (SVN) 
Summary0028102: After the first TBitmap.Draw operation (or CopyRect!), subsequent Draw (or CopyRect!) operations draw the old image
Descriptionprocedure 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!
TagsNo tags attached.
Fixed in Revision49057
LazTarget-
WidgetsetCocoa
Attached Files

Relationships

related to 0028692 resolvedFelipe Monteiro de Carvalho Cocoa: toolbar, icons repaint with black pixels 
related to 0032749 closedDmitry Boyarintsev Cocoa: Unable to draw on top of JPEG images 

Activities

Felipe Monteiro de Carvalho

2015-05-16 11:50

developer   ~0083637

I know so far what is not the cause:

1> It is not TForm.Canvas operations failling after the first .Draw, you can demonstrate that TextOut will work fine in TForm.Canvas after the first .Draw

2> Its not TBitmap.Canvas draw operations failling aftere the first .Draw, you can draw to it and save the result with SaveToImage

Issue History

Date Modified Username Field Change
2015-05-16 11:38 Felipe Monteiro de Carvalho New Issue
2015-05-16 11:38 Felipe Monteiro de Carvalho Status new => assigned
2015-05-16 11:38 Felipe Monteiro de Carvalho Assigned To => Felipe Monteiro de Carvalho
2015-05-16 11:50 Felipe Monteiro de Carvalho Note Added: 0083637
2015-05-17 07:31 Felipe Monteiro de Carvalho Fixed in Revision => 49057
2015-05-17 07:31 Felipe Monteiro de Carvalho Status assigned => resolved
2015-05-17 07:31 Felipe Monteiro de Carvalho Fixed in Version => 1.5 (SVN)
2015-05-17 07:31 Felipe Monteiro de Carvalho Resolution open => fixed
2016-08-01 20:35 Felipe Monteiro de Carvalho Relationship added related to 0028692
2017-12-14 07:42 Dmitry Boyarintsev Relationship added related to 0032749