Vcl.Graphics.TMetafileCanvas.Create

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

constructor Create(AMetafile: TMetafile; ReferenceDevice: HDC);

C++

__fastcall TMetafileCanvas(TMetafile* AMetafile, HDC ReferenceDevice);
__fastcall TMetafileCanvas(TMetafile* AMetafile, HDC ReferenceDevice, const System::UnicodeString CreatedBy, const System::UnicodeString Description);

Properties

Type Visibility Source Unit Parent
constructor public
Vcl.Graphics.pas
Vcl.Graphics.hpp
Vcl.Graphics TMetafileCanvas

Description

Creates an instance of TMetafileCanvas and acquires a handle to a metafile device context.

Call Create to create an instantiate a TMetafileCanvas object. Pass in the associated metafile whose image is about to be drawn as the AMetafile parameter. Pass in a handle to a device context on which to base the metafile's device context as the ReferenceDevice parameter. In most cases, this is the device context for a window on which the image is normally drawn.

Create sets the size of the TMetafile object from ReferenceDevice if it does not already have the MMHeight and MMWidth properties set. Create then creates a metafile device context, and sets the Handle property to its handle. All subsequent drawing methods will draw to the metafile device context.

When the TMetafileCanvas is destroyed, The CreatedBy and Description string parameters will be used to set the properties of the same name in the TMetafile object.

See Also

Code Examples