FMX.Graphics.TCanvas.BeginScene
Delphi
function BeginScene(AClipRects: PClipRects = nil; AContextHandle: THandle = 0): Boolean;
C++
bool __fastcall BeginScene(PClipRects AClipRects = (PClipRects)(0x0), NativeUInt AContextHandle = (NativeUInt)(0x0));
Properties
Type | Visibility | Source | Unit | Parent |
---|---|---|---|---|
function | public | FMX.Graphics.pas FMX.Graphics.hpp |
FMX.Graphics | TCanvas |
Description
Notifies the TCanvas object that the drawing can begin.
Call BeginScene before drawing on the TCanvas.
To end the drawing session, call EndScene.
If an application has called BeginScene and BeginScene returns True, then the application must call EndScene. That is, the recommended call pattern should look like this:
if Canvas.BeginScene then try Canvas.xxx //drawing image operations ... finally Canvas.EndScene; end;
Each time the TCanvas object calls BeginScene and BeginScene returns True, the value of the BeginSceneCount property is increased by one. Each time the TCanvas object calls EndScene, the value of the BeginSceneCount property is decreased by one. BeginScene uses BeginSceneCount to guaranty that the TCanvas object has no more than one initialized drawing at any moment.
Tip: The TForm.OnPaint event handler of a form does not need to call BeginScene explicitly.