CGpGraphics.FromImagemethod
Creates a **Graphics** object that is associated with a specified **Image** object.
Syntax
FUNCTION FromImage (BYVAL pImage AS CGpImage PTR) AS GpStatus
Parameters
| Name | Description | |
|---|---|---|
pImage | Pointer to an Image object that will be associated with the new Graphics object. |
Return value
If the function succeeds, it returns StatusOk, which is an element of the GpStatus enumeration.
If the function fails, it returns one of the other elements of the GpStatus enumeration.
Description
Creates a Graphics object that is associated with a specified Image object.
This method 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 method also fails if the image uses one of the following pixel formats:
PixelFormatUndefined
PixelFormatDontCare
PixelFormat1bppIndexed
PixelFormat4bppIndexed
PixelFormat8bppIndexed
PixelFormat16bppGrayScale
PixelFormat16bppARGB1555
Reference
- Include file
CGpGraphics.inc - Defined in AfxNova/CGpGraphics.inc:90
- Documented in Graphics/GdiPlus Classes/CGpGraphics Classes.md
- Topic: CGpGraphics Class