Vcl.Direct2D.TDirect2DCanvas.Create
Delphi
constructor Create(DC: HDC; SubRect: TRect); overload;
constructor Create(Canvas: TCanvas; SubRect: TRect); overload;
constructor Create(Handle : HWND); overload;
C++
__fastcall TDirect2DCanvas(HDC DC, const System::Types::TRect &SubRect)/* overload */;
__fastcall TDirect2DCanvas(Vcl::Graphics::TCanvas* Canvas, const System::Types::TRect &SubRect)/* overload */;
__fastcall TDirect2DCanvas(HWND Handle)/* overload */;
Properties
Type | Visibility | Source | Unit | Parent |
---|---|---|---|---|
constructor | public | Vcl.Direct2D.pas Vcl.Direct2D.hpp |
Vcl.Direct2D | TDirect2DCanvas |
Description
Creates an instance of TDirect2DCanvas.
Call Create to instantiate a TDirect2DCanvas object at run time. Create allocates memory for the instance and initializes the Direct2D backend.
A TDirect2DCanvas canvas can only be created for an already existing window or DC (device context). Create is an overloaded constructor that has three forms:
- One that accepts a DC handle and a rectangle. The contents of the given rectangle will be drawn using the Direct2D canvas.
- One that accepts a VCL TCanvas object and a rectangle. The contents of the given rectangle will be drawn using the Direct2D canvas.
- One that accepts a window handle. The newly created Direct2D canvas will be used to draw the contents of that window.
Note: TDirect2DCanvas will only work for on-screen device contexts. You cannot use the TDirect2DCanvas to draw on a printer device context, for example.