Steema Issues Database

Note: This database is for bugs and wishes only. For technical support help, if you are a customer please visit our online forums;
otherwise you can use StackOverflow.
Before using this bug-tracker we recommend a look at this document, Steema Bug Fixing Policy.



Bug 2420

Summary: SaveToBitmapFile saves always the same bitmap
Product: VCL TeeChart Reporter: SVogler <sigmund.vogler>
Component: ChartAssignee: Steema Issue Manager <issuemanager>
Status: RESOLVED WORKSFORME    
Severity: minor CC: yeray
Priority: Lowest    
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows   
Chart Series: --- Delphi / C++ Builder RAD IDE Version: RAD 10.3 Rio
Attachments: project from forums

Description SVogler 2021-05-05 08:09:27 EDT
also after the TChart has been changed!
Comment 1 SVogler 2021-05-07 03:04:04 EDT
Solved by using this:

https://www.steema.com/support/viewtopic.php?p=30317


Var
   BMP:    TBitmap;
begin
   BMP := TBitmap.Create;
    
   MyChart.Canvas.ReferenceCanvas.Lock;
   BMP.Assign(c_Profil.TeeCreateBitmap(clnone, c_Profil.canvas.bounds, pfDevice, 0));
   MyChart.Canvas.ReferenceCanvas.Unlock;
   BMP.SaveToFile(fnBMP);
end;
Comment 2 SVogler 2021-05-07 03:08:06 EDT
 Solved by using this:

https://www.steema.com/support/viewtopic.php?p=30317

Var
   BMP:    TBitmap;
begin
   BMP := TBitmap.Create;
   with MyChart Do begin    
      Canvas.ReferenceCanvas.Lock;
      BMP.Assign(TeeCreateBitmap(clnone, canvas.bounds, pfDevice, 0));
      Canvas.ReferenceCanvas.Unlock;
   end;
   BMP.SaveToFile(fnBMP);
   BMP.Free;
end;
Comment 3 yeray alonso 2021-05-07 03:11:20 EDT
Created attachment 961 [details]
project from forums

I'm attaching here the project from the forums in case the link dies.

Also, I'm closing this issue since the code suggested seems to solve the problem.