CGpGraphics.Constructorsconstructor
Creates a **Graphics** object.
Syntax
CONSTRUCTOR CGpGraphics (BYVAL hdc AS HDC)
CONSTRUCTOR CGpGraphics (BYVAL hdc AS HDC, BYVAL hDevice AS HANDLE)
CONSTRUCTOR CGpGraphics (BYVAL hwnd AS HWND, BYVAL icm AS BOOLEAN = FALSE)
CONSTRUCTOR CGpGraphics (BYVAL pImage AS CGpImage PTR)
CONSTRUCTOR CGpGraphics (BYVAL pImage AS CGpImage PTR)
Parameters
| Name | Description | |
|---|---|---|
hdc | Handle to the device context that will be associated with the new Graphics object. | |
hDevice | Handle to a device that will be associated with the new Graphics object. | |
hwnd | Handle to a window that will be associated with the new Graphics object. | |
icm | Optional. Boolean value that specifies whether the new Graphics object applies color adjustment according to the ICC profile associated with the display device. TRUE specifies that color adjustment is applied, and FALSE specifies that color adjustment is not applied. The default value is FALSE. | |
pImage | Pointer to an Image object that will be associated with the new Graphics object. |
Description
Creates a Graphics object that is associated with a specified device context. When you use this method to create a Graphics object, make sure that the Graphics object is deleted before the device context is released.
Creates a Graphics object that is associated with a specified device context and a specified device. When you use this constructor to create a Graphics object, make sure that the Graphics object is deleted or goes out of scope before the device context is released.
Creates a Graphics object that is associated with a specified window.
Creates a Graphics object that is associated with an Image object. This constructor fails if the Image object is based on a metafile that was opened for reading. The Image(file) and Metafile(file) constructors open a metafile for reading. To open a metafile for recording, use a Metafile constructor that receives a device context handle.
This constructor also fails if the image uses one of the following pixel formats:
PixelFormatUndefined
PixelFormatDontCare
PixelFormat1bppIndexed
PixelFormat4bppIndexed
PixelFormat8bppIndexed
PixelFormat16bppGrayScale
PixelFormat16bppARGB1555
Reference
- Include file
CGpGraphics.inc - Documented in Graphics/GdiPlus Classes/CGpGraphics Classes.md
- Topic: CGpGraphics Class