Share via


GDI Plus Base Foundation Class

The gpBase class is the abstract base class for all other _GDIPLUS classes and provides some basic utility methods.

Category

Reporting

Default Catalog

Visual FoxPro Catalog\Foundation Classes\Output\GDIplus

Class

gpBase

Base Class

Custom

Class Library

_GDIPLUS.vcx

Parent Class

Custom (Custom Object)

Remarks

The following table lists public properties and methods added by this class to its parent class, Custom.

Properties and methods

Description

AllowModalMessages Property

Determines whether the class is allowed to display modal dialog boxes to provide user feedback.

Default INLIST(_VFP.StartMode,0,4)

Remarks: Affects the UI that error handler presents when QuietOnError is false. If AllowModalMessages=.T., then a modal message box is shown and processing stops. If AllowModalMessages=.F., then a WAIT WINDOW ... NOWAIT command is used and processing continues.

AppName Property

Application name for use in user feedback.

Default "GDI+ FFC Library"

ClearErrors Method

Resets the object's error status.

Syntax: THIS.ClearErrors()

Return Values: None

Parameters:  None.

Clone Method

Create a new object as an exact copy of an existing object.

Syntax: THIS.Clone()

Return Values: None

Parameters:  toClone, required, object to make this object a clone of.

Remarks: This function has no meaning in the GpBase class. It is implemented in most subclasses. For objects that wrap an underlying GDI+ object, the underlying object is cloned as well.

GetErrorStatus Method

Indicates whether an error has occurred.

Syntax: lError = THIS.GetErrorStatus()

Return Values: Logical.

Parameters:  None.

Remarks: Returns True (.T.) if an error has occurred since the last call to ClearError().

GetLastErrorMessage Method

Provides information about the last error that occurred.

Syntax: cErrorMessage = THIS.getLastErrorMessage()

Return Values: String. cErrorMessage is the text of the last error to occur.

Parameters:  None.

Remarks: The value of cErrorMessage is only valid when GetErrorStatus() returns True (.T.).

GUIDToString Method

Converts GUID or CLSID from binary form to human-readable string representation.

Syntax: cGUIDString = THIS.GUIDToString(tqGUID)

Return Values: String, in standard {abcdefab-cdef–abcd-efab-cdefabcdefab} format. Returns null (.NULL.) if an error occurs.

Parameters: 

tqQUID is the GUID or CLSID to be converted.

IgnoreErrors Property

Indicates whether errors should halt processing.

Default .F.

MakeGdipArrayF Method

Converts numeric values in a Visual FoxPro array to a binary string, representing a one- or two-dimensional array of float (single-precision) values, suitable for passing directly to native GDI or GDI+ functions.

Syntax: cArrayString = THIS.MakeGdipArrayF(taArray[, tnCols[, tnFirstCol]])

Return Values: Array represented in a string. Each value takes four bytes. The total length of the string is thus (ALEN(taArray,1) * tnCols*4). Returns null (.NULL.) if an error occurs.

Parameters: 

taArray, required, is an array of number values. Must have at least tnCols.

tnCols, optional, is the number of columns to convert. Defaults to the number of values in the array.

tnFirstCol, optional, is the first column number to start the conversion. Defaults to 1.

MakeGdipArrayFFromCursor Method

Converts numeric values in a Visual FoxPro cursor to a binary string, representing a one- or two-dimensional array of float (single-precision) values, suitable for passing directly to native GDI or GDI+ functions.

Syntax: cArrayString = THIS.MakeGdipArrayFFromCursor(tcAlias, tnCols, tcExpr1[, tcExpr2[, tcExpr3[, tcExpr4[, tcExpr5[, tcExpr6[, tcExpr7[, tcExpr8]]]]]]])

Return Values: Array represented in a string. Each value takes four bytes. The total length of the string.is thus (RECCOUNT(tcAlias) * tnCols*4). Returns null (.NULL.) if an error occurs.

Parameters: 

tcAlias, required, is the alias of a cursor. Must have at least tnCols fields.

tnCols, required, is the number of columns the array must have. At least tnCols expressions must be specified in the following parameters.

tcExpr1, required, is the expression for the first column (usually a field name).

tcExpr2, required if tnCols is >=2, is the expression for the second column (usually a field name).

tcExpr3, required if tnCols is >=3, is the expression for the third column (usually a field name).

tcExpr4, required if tnCols is >=4, is the expression for the fourth column (usually a field name).

tcExpr5, required if tnCols is >=5 is the expression for the fifth column (usually a field name).

tcExpr6, required if tnCols is >=6 is the expression for the sixth column (usually a field name).

tcExpr7, required if tnCols is >=7 is the expression for the seventh column (usually a field name).

tcExpr8, required if tnCols >= 8 is the expression for the eighth column (usually a field name).

MakeGdipPointF Method

Creates GDI+ PointF structure as string, from separate x,y parameters.

Syntax: cString = MakeGdipPointF(tX, tY)

Return Values: 8-byte string representing two float values. Returns null (.NULL.) on error.

Parameters: 

tX, required, numeric, the X coordinate of the point.

tY, required, numeric, the Y coordinate of the point.

MakeGdipRectF Method

Creates GDI+ RectF structure as string, from separate x,y,w,h parameters.

Syntax: cString = MakeGdipRectF(tX, tY, tW, tH)

Return Values: 16-byte string representing four float values. Returns null (.NULL.) on error.

Parameters: 

tX, required, numeric, the X coordinate of the point.

tY, required, numeric, the Y coordinate of the point.

tW, required, numeric, the Width value (horizontal dimension).

tH, required, numeric, the Height value (vertical dimension).

MakeGdipSizeF Method

Creates GDI+ SizeF structure as string, from separate x and y parameters.

Syntax: cString = MakeGdipSizeF(tW, tH)

Return Values: 8-byte string representing two float values. Returns null (.NULL.) on error.

Parameters: 

tW, required, numeric, the Width value (horizontal dimension).

tH, required, numeric, the Height value (vertical dimension).

ObjFactory Method

Internal function to create _GDIPLUS objects. Used primarily by _GDIPLUS-derived objects' methods that return object values.

Syntax: oObject = ;

THIS.ObjFactory( tcContext, tcClassname [, p1,p2,p3...p10 ] )

Return Values: The created object. Returns null (.NULL.) on error.

Parameters: 

tcContext, string, the context of the object creation, usually a value in the form "class.methodname".

tcClassName, string, the name of the class to instantiate. Always one of the base _GDIPLUS classes (such as "gprect").

Remarks: This function along with ObjFactoryHook() can be used to change the classes used by the GDI+ foundation classes. Refer to the GDIPLUS_CLASS_* constants defined in GDIPLUS.H for default values.

ObjFactoryHook Method

Allows modifications to the class that will be created by ObjFactory().

Syntax: THIS.ObjFactoryHook( tcContext, @rcClassName, @rcClassLibrary, @rcModule )

Return Values: none.

Parameters: 

tcContext, string, context value passed to ObjFactory().

rcClassName, string, the class that will be created. Assign a value to this parameter to change the class that will be instantiated.

rcClassLibrary, string, the default class library in which the class to be created should be found.

rcModule, string, the module (.app, .dll or .exe file). By default will be an empty string ("").

QuietOnError Property

If True (.T.), causes error messages to be suppressed.

Default NOT INLIST(_VFP.StartMode,0,4)

StringToGUID Method

Converts a human-readable string representation of a GUID or CLSID to binary form.

Syntax: qGUID = THIS.StringToGUID(tcString)

Return Values: qQUID is the GUID or CLSID as a 16-byte varbinary value. Returns null (.NULL.) if an error occurs.

Parameters:  tcString is a human-readable GUID or CLSID in standard {abcdefab-cdef–abcd-efab-cdefabcdefab} format.

See Also

Concepts

Guidelines for Using Visual FoxPro Foundation Classes

Reference

Visual FoxPro Foundation Classes A-Z

GDI Plus API Wrapper Foundation Classes