GDI Plus Image Foundation Class
The gpImage class encapsulates a GDI+ image, and serves as the base class for specific image types (for example, the gpBitmap class).
Category | Reporting |
---|---|
Default Catalog |
Visual FoxPro Catalog\Foundation Classes\Output\GDIplus |
Class |
gpImage |
Base Class |
Custom |
Class Library |
_GDIPLUS.vcx |
Parent Class |
gpObject (GDI Plus Object Foundation Class) |
Remarks
The following table lists public properties and methods added by this class to its parent class, gpObject. This class also implements the Init and Clone methods.
Properties and methods | Description | ||||||||
---|---|---|---|---|---|---|---|---|---|
Clone Method |
Clones an image object. Syntax: Return Values: Logical, representing success or failure. Parameters: toGpImage, required, the gpImage-based object to clone. |
||||||||
CreateFromFile Method |
Creates an image object from a file. Syntax: Return Values: Logical, representing success or failure. Parameters: tcFileName, required, the image file from which to create the image object. tlUseEmbeddedColorMgmt, optional, whether to use embedded color management. |
||||||||
Flags Property |
Specifies attribute flags for this image as an integer computed as a combination of bit values, using the GDIPLUS_ImageFlags_* defined constants. Default: Empty. |
||||||||
GetBounds Method |
Gets a bounding rectangle in the specified units. Syntax: Return Values: an object of type gpRectangle, or null ( Parameters: tnUnits, required, specified according to the GDIPLUS_Unit_* set of constants. |
||||||||
GetDecoderCLSID Method |
Gets the CLSID for the Decoder for a specific image format (for example, " Syntax: Return Values: Varbinary, CLSID of Decoder. Returns null ( Parameters: tvSearchValue, required. A string containing MIME type of image (eg Remarks: If no decoder is found for the specified image type, or if the image format MIME type or GUID supplied in tvSearchValue is invalid, then this function returns |
||||||||
GetEncoderCLSID Method |
Gets the CLSID for the encoder for a specific image format (for example, " Syntax: Return Values: Varbinary, CLSID of encoder suitable for passing to SaveToFile() method. Returns null ( Parameters: tvSearchValue, required. A string containing MIME type of image (eg Remarks: If no encoder is found for the specified image type, or if the image format MIME type or GUID supplied in tvSearchValue is invalid, then this function returns |
||||||||
GetPropertyCount Method |
Gets the number of properties stored in the metadata of this image object. Syntax: Return Values: Integer, number of meta data properties (which could be zero). Returns null ( Parameters: none. |
||||||||
GetPropertyIdList Method |
Gets a list of all the properties stored in the image metadata, as a Visual FoxPro array. Syntax: Return Values: Integer, number of meta data properties (which could be zero). Returns null ( Parameters: raPropIDList, required, array passed by reference. On return, this array is dimensioned to a 1-dimensional array, and each element of the array contains an integer property ID value. |
||||||||
GetPropertyItem Method |
Retrieves the specified property from the image metadata. Syntax: Returns:
Property types not shown here are not supported. Parameters: tnPropID, required, integer, a property item ID as returned by GetPropertyIDList. Remarks: If the requested property is not defined, this method returns null ( |
||||||||
GetThumbnailImage Method |
Gets a thumbnail image from the image object, returned as a new gpImage object. Syntax: Return Values:gpImage object containing a thumbnail. Returns null ( Parameters: tnWidth, integer, required, desired width of thumbnail in pixels. tnHeight, integer, required, desired width of thumbnail in pixels. Remarks: Some image files have a thumbnail image embedded in the file. In such cases, this method retrieves the embedded thumbnail image and the tnWidth and tnHeight parameter values are ignored. If there is no embedded thumbnail image, this method creates a thumbnail image by scaling the main image to the size specified in the tnWidth and tnHeight parameters. If both of those parameters are |
||||||||
HorizontalResolution Property |
Numeric, horizontal resolution in pixels-per-inch. Read-only. Default: none. |
||||||||
ImageHeight Property |
Height of this Image object. Read-only. Default: none. |
||||||||
ImageWidth Property |
Width of this Image object. Read-only. Default: none. |
||||||||
Init Method |
Constructs an Image object during initialization if passed appropriate arguments. Syntax: Return Values: Logical, representing success or failure. If the method fails, the object does not instantiate. Parameters: tnHandle | tcFilename, required if immediate creation of the object is requested, a graphics handle or filename from which the image will be created. tlParam, optional, indicates whether the class owns the graphics handle (if the first parameter is tnHandle) or whether color management should be used (if the first parameter is tcFileName). |
||||||||
PhysicalDimension Property |
Provides the width and height of this image object, as an object of type gpSize. Read-only. Default: none. Remarks: If the image is a bitmap, the width and height are returned in pixels. If the image is a metafile, the width and height are returned in 0.01 millimeter units. |
||||||||
PixelFormat Property |
Pixel format, according to the values specified in GP_PIXELFORMAT_* constants. Read-only. Default: none. Remarks: May not apply to some image objects, such as vector-format images. |
||||||||
RawFormat Property |
Get the format of this image as a GUID of varbinary type. Read-only. Default: none. |
||||||||
RotateFlip Method |
Rotates and/or flips (mirrors) the image object. Syntax: Return Values: Logical, representing success or failure. Parameters: tnRotateFlipType, required, integer. Specifies angle of rotation and/or type of flip, according to the values specified in the GDIPLUS_ROTATEFLIPTYPE_* defined constants. |
||||||||
SaveToFile Method |
Saves the image object to a disk file, using specified encoder or image format and optional parameters. Syntax: Return Values: Logical, representing success or failure. Parameters: tcFilename, required, string, the file name to which the image should be saved. tvCLSIDEncoder, required, string or varbinary. The CLSID of the encoder to use, or a MIME type (eg " rvEncoderParams, optional, parameters for the encoder. Either a comma-separated string in the form " Remarks: The encoder parameters are defined internally by globally unique IDs (GUIDS). This function understands a limited set of parameters by name:
To pass other parameters, use the array form of rvEncoderParams with the GUID of the parameter in the first column. The following example saves an image to a JPEG file, using a quality of 80%.
|
||||||||
VerticalResolution Property |
Numeric, vertical resolution in pixels-per-inch. Read-only. Default: none. |
See Also
Reference
Visual FoxPro Foundation Classes A-Z
GDI Plus API Wrapper Foundation Classes