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 2592 - TChart.Canvas throws BeginScene error
Summary: TChart.Canvas throws BeginScene error
Status: RESOLVED WONTFIX
Alias: None
Product: FireMonkey TeeChart
Classification: Unclassified
Component: Chart (show other bugs)
Version: unspecified
Hardware: PC Windows
: High major
Target Milestone: ---
Assignee: Steema Issue Manager
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-03-01 03:32 EST by Reini
Modified: 2023-03-13 13:26 EDT (History)
1 user (show)

See Also:
Chart Series: ---
Delphi / C++ Builder RAD IDE Version: RAD 11 Alexandria


Attachments
Sample application to show BeginScene exception (163.83 KB, application/x-zip-compressed)
2023-03-01 03:32 EST, Reini
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Reini 2023-03-01 03:32:11 EST
Created attachment 1037 [details]
Sample application to show BeginScene exception

This bug is also reported to Embarcadero under:
https://quality.embarcadero.com/browse/RSP-40271
It should be solved in Delphi release 11.3 but it isn't.
It is reproducable with TChart Lite v2021.32.210722
The problem lies in TChart.Canvas that does not call BeginScene. Please build the attached application and notice the exception (under both Delphi 11.2 and Delphi 11.3). The error did not occur when compiled with Delphi 10.4
In the sample application, after pressing the button names "default", the application will try to draw a circle on the canvas of the TChart. Then the error occurs
Comment 1 yeray alonso 2023-03-13 13:26:20 EDT
We won't add `BeginScene`/`EndScene` in all our `TTeeCanvas3D` primitives. It wouldn't be a good design.

So I'd suggest to do it yourself as you did in the comments. Just note you need to use `ReferenceCanvas`:

  EqChart.Canvas.ReferenceCanvas.BeginScene;
  // Do your custom drawing here
  EqChart.Canvas.ReferenceCanvas.EndScene;

Also, I'd suggest you to do the custom drawings at the `OnAfterDraw` event instead of at the button `OnClick`.