Partager via


GDI Plus Graphics Foundation Class

The gpGraphics class encapsulates a GDI+ drawing surface. It provides methods for drawing on a window or other canvas.

Category

Reporting

Default Catalog

Visual FoxPro Catalog\Foundation Classes\Output\GDIplus

Class

gpGraphics

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.

Properties and methods

Description

Clear Method

Clears entire drawing surface and fills with specified background color.

Syntax: THIS.Clear(tvColor)

Return Values: Logical, representing success or failure.

Parameters: 

tvColor, required, a GDI Plus Color Foundation Class or ARGB color value.

ClipBounds Property

A clipping region represented as a GDI Plus Rectangle Foundation Class. Read-only.

Default: Empty.

Remarks: If the clipping region is infinite, this member returns a meaningless large rectangle. See VisibleClipBounds Property.

CompositingMode Property

Specifies how composited images are drawn to this graphics object with possible values indicated by GDIPLUS_CompositingMode_* constants. Read-write.

Default: Empty.

CompositingQuality Property

Specifies the rendering quality of composited images drawn to this graphics object with possible values indicated by GDIPLUS_CompositingQuality_* constants.

Default: Empty.

CreateFromHDC Method

Creates a graphics object for a given device context (HDC).

Syntax: THIS.CreateFromHDC(hDC)

Return Values: Logical, representing success or failure.

Parameters: 

hDC, required, numeric, Windows Device Context handle.

CreateFromHWND Method

Creates a graphics object for a given window (HWND).

Syntax: THIS.CreateFromHWND(hWND[, tlICM])

Return Values: Logical, representing success or failure.

Parameters: 

hWND, required, numeric, represents a handle to a window.

tlICM, optional, indicates whether to use image color management.

CreateFromImage Method

Creates a graphics object from the specified gpImage object, so you can draw on that image's surface.

Syntax: THIS.CreateFromImage(toImage)

Return Values: Logical, representing success or failure.

Parameters: 

toImage, required, a gpImage object.

DpiX Property

Specifies the horizontal resolution of drawing surface in dots per inch. Read-only.

Default: Empty.

DpiY Property

Specifies the vertical resolution of drawing surface in dots per inch. Read-only.

Default: Empty.

DrawArc Method

Draws an arc representing a portion of an ellipse, given the bounding rectangle of the ellipse, start, and sweep angles.

Syntax: THIS.DrawArc(toPen,tX,tY,tnW, tnH, tnStart, tnSweep)

Return Values: Logical, representing success or failure.

Parameters: 

toPen, required, gpPen to use.

tnX, numeric, X-coordinate of top-left corner of bounding rectangle.

tnY, numeric, Y-coordinate of top-left corner of bounding rectangle.

tnW, numeric, width of bounding rectangle.

tnH, numeric, height of bounding rectangle.

tnStart, numeric, starting angle specified in degrees.

tnSweep, numeric, sweep angle specified in degrees.

DrawBezier Method

Draws a Bézier spline from four control points.

Syntax: THIS.DrawBezier(toPen,tX1,tY1, tX2,tY2, tX3,tY3, tX4,tY4)

Return Values: Logical, representing success or failure.

Parameters: 

toPen, required, gpPen to use.

tx1, numeric, X-coordinate of 1st control point.

ty1, numeric, Y-coordinate of 1st control point.

tx2, numeric, X-coordinate of 2nd control point.

ty2, numeric, Y-coordinate of 2nd control point.

tx3, numeric, X-coordinate of 3rd control point.

ty3, numeric, Y-coordinate of 3rd control point.

tx4, numeric, X-coordinate of 4th control point.

ty4, numeric, Y-coordinate of 4th control point.

DrawBeziers Method

Draws a series of Bézier splines, given a Visual FoxPro array of points.

Syntax: THIS.DrawBeziers(toPen, taPoints[, tnFirstCol])

Return Values: Logical, representing success or failure.

Parameters: 

toPen, required, gpPen to use.

taPoints, required, array containing coordinates of the end points. The array has one row for each point, and must have at least two columns, with taArray[i, tnFirstCol] containing the X-coordinate and taArray[i,tnFirstCol+1] containing the Y-coordinate.

tnFirstCol, optional, integer column index of the X-coordinate. Defaults to 1.

DrawBeziersFromCursor Method

Draws a series of Bézier splines, given a set of points defined in a Visual FoxPro cursor.

Syntax: ? THIS.DrawBeziersFromCursor(toPen, tcAlias, tcExprX, tcExprY)

Return Values: Logical, representing success or failure.

Parameters: 

toPen, required, gpPen to use.

tcAlias, required, alias of cursor containing coordinates of the points, one row for each point.

tcExprX, required, string, expression to evaluate for X-coordinate (must evaluate to numeric).

tcExprY, required, string, expression to evaluate for Y-coordinate (must evaluate to numeric).

DrawClosedCurve Method

Draws a closed curve through a set of points defined in a Visual FoxPro array.

Syntax: THIS.DrawClosedCurve(toPen, taPoints[, tnFirstCol])

Return Values: Logical, representing success or failure.

Parameters: 

toPen, required, gpPen to draw with.

taPoints, required, array containing coordinates of the points. The array has one row for each point, and must have at least two columns, with taArray[i, tnFirstCol] containing the X-coordinate and taArray[i,tnFirstCol+1] containing the Y-coordinate.

tnFirstCol, optional. Integer column index of the X-coordinate. Defaults to 1.

DrawClosedCurveFromCursor Method

Draws a closed curve through a set of points defined in a Visual FoxPro cursor.

Syntax: THIS.DrawClosedCurveFromCursor(toPen, tcAlias, tcExprX, tcExprY)

Return Values: Logical, representing success or failure.

Parameters: 

toPen, required, gpPen to use.

tcAlias, required, alias of cursor containing coordinates of the points, one row for each point.

tcExprX, required, string, expression to evaluate for X-coordinate (must evaluate to numeric).

tcExprY, required, string, expression to evaluate for Y-coordinate (must evaluate to numeric).

DrawCurve Method

Draws a curve through a set of points defined in a Visual FoxPro array.

Syntax: THIS.DrawCurve(toPen, taPoints[, tnFirstCol])

Return Values: Logical, representing success or failure.

Parameters: 

toPen, required, gpPen to draw with.

taPoints, required, Array containing coordinates of the points. The array has one row for each point, and must have at least two columns, with taArray[i, tnFirstCol] containing the X-coordinate and taArray[i,tnFirstCol+1] containing the Y-coordinate.

tnFirstCol, optional. Integer column index of the X-coordinate. Defaults to 1.

DrawCurveFromCursor Method

Draws a curve through a set of points defined in a Visual FoxPro cursor.

Syntax: THIS.DrawCurveFromCursor(toPen, tcAlias, tcExprX, tcExprY)

Return Values: Logical, representing success or failure.

Parameters: 

toPen, required, gpPen to use.

tcAlias, required, alias of cursor containing coordinates of the points, one row for each point.

tcExprX, required, string, expression to evaluate for X-coordinate (must evaluate to numeric).

tcExprY, required, string, expression to evaluate for Y-coordinate (must evaluate to numeric).

DrawEllipse Method

Draws an outlined ellipse specified by its bounding rectangle.

Syntax: THIS.DrawEllipse(toPen, tXOrRectangle[,tnY,tnW,tnH])

Return Values: Logical, representing success or failure.

Parameters: 

toPen, required, gpPen to use.

tXOrRectangle, either a gpRectangle object specifying bounding rectangle or a numeric value specifying the X-coordinate of top-left corner of bounding rectangle

tnY, numeric, Y-coordinate of top-left corner of bounding rectangle. Required if tXorRectangle is numeric.

tnW, numeric, width of bounding rectangle. Required if tXorRectangle is numeric.

tnH, numeric, height of bounding rectangle. Required if tXorRectangle is numeric.

DrawImageAt Method

Draws image at the specified location, using its original physical size.

Syntax: THIS.DrawImageAt(toImage, destPointOrX[,destY])

Return Values: Logical, representing success or failure.

Parameters: 

toImage, required, the gpImage object (or an instance of a class derived from gpImage) to draw.

destPointOrX, either a gpPoint object indicating the point at which to draw image, or numeric value, the X-coordinate of location to draw image.

destY, numeric, Y-coordinate of location to draw image. Required if tPointOrX is numeric.

DrawImagePortionAt Method

Draws portion of an image at the specified location, using its original size.

Syntax: THIS.DrawImagePortionAt(toImage, destPoint,srcRectangle[, srcUnit])

Return Values: Logical, representing success or failure.

Parameters: 

toImage, required, the gpImage object (or an instance of a class derived from gpImage) to draw.

destPoint, required, a gpPoint object specifying destination location.

srcRectangle, required, a gpRectangle object specifying the portion of image to draw.

srcUnit, optional, the unit of measure for the source image, as defined in GDIPLUS_Unit_* constants.

DrawImagePortionScaled Method

Draws portion of an image at the specified location and with the specified size.

Syntax: THIS.DrawImagePortionScaled(toImage, destRectangle,srcRectangle[, srcUnit[, imageAttribs]])

Return Values: Logical, representing success or failure.

Parameters: 

toImage, required, the gpImage object (or an instance of a class derived from gpImage) to draw.

destRectangle, required, a gpRectangle object specifying destination location.

srcRectangle, required, a gpRectangle object specifying the portion of image to draw.

srcUnit, optional, the unit of measure for the source image, as defined in GDIPLUS_Unit_* constants.

imageAttribs, optional, an integer GDI+ handle for a GDI+ ImageAttributes object, or an instance of gpObject providing a wrapper for a GDI+ ImageAttributes object.

DrawImageScaled Method

Draws image at the specified location with the specified size.

Syntax: THIS.DrawImageScaled(toImage, destRectangleOrX, destY,destW,destH)

Return Values: Logical, representing success or failure.

Parameters: 

toImage, required, the gpImage object (or an instance of a class derived from gpImage) to draw.

destRectangleOrX, required, either a gpRectangle object specifying the destination location or a numeric value, the X-coordinate of the destination location.

destY, numeric, Y-coordinate of location to draw image. Required if destRectangleOrX is numeric.

destW, numeric, desired width of image to be drawn. Required if destRectangleOrX is numeric.

destH, numeric, desired height of image to be drawn. Required if destRectangleOrX is numeric.

DrawLine Method

Draws a line between two points, in the specified pen.

Syntax: THIS.DrawLine(toPen, x1,y1,x2,y2)

Return Values: Logical, representing success or failure.

Parameters: 

toPen, required, gpPen to use.

x1, required, numeric, X-coordinate of start point.

y1, required, numeric, Y-coordinate of start point.

x2, required, numeric, X-coordinate of end point.

y2, required, numeric, Y-coordinate of end point.

DrawLines Method

Draws a sequence of connected lines, given the endpoints of each line in a Visual FoxPro array.

Syntax: THIS.DrawLines( toPen, taPoints [, tnFirstCol ] )

Return Values: Logical, representing success or failure.

Parameters: 

toPen, required, gpPen to use.

taPoints, required, an array containing coordinates of the end points. The array has one row for each point, and must have at least two columns, with taArray[i, tnFirstCol] containing the X-coordinate and taArray[i,tnFirstCol+1] containing the Y-coordinate.

tnFirstCol, optional, an integer column index of the X-coordinate. Defaults to 1.

DrawLinesFromCursor Method

Draws a sequence of connected lines, given the endpoints of each line in a Visual FoxPro cursor.

Syntax: THIS.DrawLinesFromCursor(toPen, tcAlias, tcExprX, tcExprY)

Return Values: Logical, representing success or failure.

Parameters: 

toPen, required, gpPen to use.

tcAlias, required, alias of cursor containing coordinates of the end points, one row for each point.

tcExprX, required, string, expression to evaluate for X-coordinate (must evaluate to numeric).

tcExprY, required, string, expression to evaluate for Y-coordinate (must evaluate to numeric).

DrawPie Method

Draws the outline of a pie slice.

Syntax: THIS.DrawPie(toPen, tXOrRectangle,tnYOrStart,tnWOrSweep,tnH[, tnStart, tnSweep])

Return Values: Logical, representing success or failure.

Parameters: 

toPen, required, the gpPen to use.

toXOrRectangle, a gpRectangle object specifying bounding rectangle or a numeric value specifying the X-coordinate of top-left corner of the bounding rectangle.

tnYOrStart, a numeric value, the Y-coordinate of top-left corner of bounding rectangle, if toXOrRectangle is numeric or the starting angle specified in degrees, if toXOrRectangle is a gpRectangle object.

tnWOrSweep, a numeric value, the width of the bounding rectangle, if toXOrRectangle is numeric, or the sweep angle specified in degrees, if toXOrRectangle is a gpRectangle object.

tnH, numeric, the height of bounding rectangle, when toXOrRectangle is numeric.

tnStart, numeric, the starting angle specified in degrees, when toXOrRectangle is numeric.

tnSweep, numeric, the sweep angle specified in degrees, when toXOrRectangle is numeric.

DrawPolygon Method

Draws a polygon defined by a set of points as specified in a Visual FoxPro array.

Syntax: THIS.DrawPolygon(toPen, taPoints[, tnFirstCol])

Return Values: Logical, representing success or failure.

Parameters: 

toPen, required, the gpPen to use.

taPoints, required, an array containing coordinates of the points. The array has one row for each point, and must have at least two columns, with taArray[i, tnFirstCol] containing the X-coordinate and taArray[i,tnFirstCol+1] containing the Y-coordinate.

tnFirstCol, optional, the integer column index of the X-coordinate. Defaults to 1.

DrawPolygonFromCursor Method

Draws a polygon defined by a set of points provided in a VisualFoxPro cursor.

Syntax: THIS.DrawPolygonFromCursor(toPen, tcAlias, tcExprX, tcExprY

Return Values: Logical, representing success or failure.

Parameters: 

toPen, required, gpPen to use.

tcAlias, required, alias of cursor containing coordinates of the points, one row for each point.

tcExprX, required, string, expression to evaluate for X-coordinate (must evaluate to numeric).

tcExprY, required, string, expression to evaluate for Y-coordinate (must evaluate to numeric).

DrawRectangle Method

Draw an outlined rectangle, defined either by a gpRectangle object, or by separate coordinate and dimension parameters.

Syntax: THIS.DrawRectangle(toPen, tXOrRectangle[,tnY,tnW,tnH])

Return Values: Logical, representing success or failure.

Parameters: 

toPen, required, gpPen to use.

tXOrRectangle, either a gpRectangle object specifying bounding rectangle or a numeric value specifying the X-coordinate of top-left corner of bounding rectangle

tnY, numeric, Y-coordinate of top-left corner of bounding rectangle. Required if tXorRectangle is numeric.

tnW, numeric, width of bounding rectangle. Required if tXorRectangle is numeric.

tnH, numeric, height of bounding rectangle. Required if tXorRectangle is numeric.

Remarks: All coordinates are in the current units of the gpGraphics object; see the PageUnit property entry.

DrawRectangles Method

Draws a set of outlined rectangles, given coordinates in a Visual FoxPro array.

Syntax: THIS.DrawRectangles(toPen, taRects[, tnFirstCol])

Return Values: Logical, representing success or failure.

Parameters: 

toPen, required, the gpPen to use.

taRects, required, an array containing coordinates of the points defining rectangles. The array has one row for each rectangle, and must have at least two columns, with taArray[i, tnFirstCol] containing the X-coordinate, taArray[i,tnFirstCol+1] containing the Y-coordinate, aArray[i, tnFirstCol+2] containing the width, and taArray[i,tnFirstCol+3] containing the height.

tnFirstCol, optional, the integer column index of the X-coordinate. Defaults to 1.

DrawRectanglesFromCursor Method

Draws a set of outlined rectangles, given coordinates in a Visual FoxPro cursor.

Syntax: THIS.DrawRectanglesFromCursor(toPen, tcAlias, tcExprX, tcExprY, tcExprW, tcExprH)

Return Values: Logical, representing success or failure.

Parameters: 

toPen, required, gpPen to use.

tcAlias, required, alias of cursor containing coordinates of the points, one row for each rectangle.

tcExprX, required, string, expression to evaluate for X-coordinate (must evaluate to numeric).

tcExprY, required, string, expression to evaluate for Y-coordinate (must evaluate to numeric).

tcExprW, required, string, expression to evaluate for width (must evaluate to numeric).

tcExprH, required, string, expression to evaluate for height (must evaluate to numeric).

DrawStringA Method

Draws a string in specified font and position (ANSI version).

Syntax: THIS.DrawStringA( tcAnsiString, [toFont],tvRectPoint,[toStringFormat],[toBrush])

Return Values: Logical, representing success or failure.

Parameters: 

tcAnsiString, required, the ANSI string to draw.

toFont, optional, a gpFont object specifying the font to use.

tvRectPoint, required, a gpRect object specifying the bounding rectangle, or a gpPoint object specifying the top left corner.

toStringFormat, optional, a gpStringFormat object.

toBrush, optional, a gpBrush object to use when drawing the text.

DrawStringW Method

Draws a string in specified font and position (Unicode Version)

Syntax: THIS.DrawStringW( tcUnicodeString,[toFont],tvRectPoint,[toStringFormat],[toBrush])

Return Values: Logical, representing success or failure.

Parameters: 

tcUnicodeString, required, the Unicode string to draw.

toFont, optional, a gpFont object specifying the font to use.

tvRectPoint, required, a gpRect object specifying the bounding rectangle, or a gpPoint object specifying the top left corner.

toStringFormat, optional, a gpStringFormat object.

toBrush, optional, a gpBrush object to use when drawing the text.

FillClosedCurve Method

Fills a closed curve defined by a set of points in a Visual FoxPro array.

Syntax: ? THIS.FillClosedCurve(toBrush, taPoints[, tnFirstCol[, tnFillMode]])

Return Values: Logical, representing success or failure.

Parameters: 

toBrush, required, the gpBrush to use.

taPoints, required, array containing coordinates of the end points. The array has one row for each point, and must have at least two columns, with taArray[i, tnFirstCol] containing the X-coordinate and taArray[i,tnFirstCol+1] containing the Y-coordinate.

tnFirstCol, optional, integer column index of the X-coordinate. Defaults to 1.

tnFillMode, optional, the fill mode as defined by the GDIPLUS_FillMode_* constants. Default value is GDIPLUS_FillMode_Alternate.

FillClosedCurveFromCursor Method

Fills a closed curve as defined by a set of points in a Visual FoxPro cursor.

Syntax: THIS.FillClosedCurveFromCursor(toBrush, tcAlias, tcExprX, tcExprY[, tnFillMode])

Return Values: Logical, representing success or failure.

Parameters: 

toBrush, required, gpBrush to use.

tcAlias, required, alias of cursor containing coordinates of the points, one row for each point.

tcExprX, required, string, expression to evaluate for X-coordinate (must evaluate to numeric).

tcExprY, required, string, expression to evaluate for Y-coordinate (must evaluate to numeric).

tnFillMode, optional, the fill mode as defined by the GDIPLUS_FillMode_* constants. Default value is GDIPLUS_FillMode_Alternate.

FillEllipse Method

Draws a filled ellipse specified by its bounding rectangle.

Syntax: ? THIS.FillEllipse(toBrush, tXOrRectangle[,tnY,tnW,tnH])

Return Values: Logical, representing success or failure.

Parameters: 

toBrush, required, gpBrush to use.

tXOrRectangle, either a gpRectangle object specifying bounding rectangle or a numeric value specifying the X-coordinate of top-left corner of bounding rectangle

tnY, numeric, Y-coordinate of top-left corner of bounding rectangle. Required if tXorRectangle is numeric.

tnW, numeric, width of bounding rectangle. Required if tXorRectangle is numeric.

tnH, numeric, height of bounding rectangle. Required if tXorRectangle is numeric.

FillPie Method

Draws a filled pie slice.

Syntax: ? THIS.FillPie(toBrush, tXOrRect,tnYOrStart,tnWOrSweep,tnH[, tnStart, tnSweep])

Return Values: Logical, representing success or failure.

Parameters: 

toBrush, required, the gpBrush to use.

toXOrRectangle, a gpRectangle object specifying bounding rectangle or a numeric value specifying the X-coordinate of top-left corner of the bounding rectangle.

tnYOrStart, a numeric value, the Y-coordinate of top-left corner of bounding rectangle, if toXOrRectangle is numeric, or the starting angle specified in degrees, if toXOrRectangle is a gpRectangle object.

tnWOrSweep, a numeric value, the width of the bounding rectangle, if toXOrRectangle is numeric, or the sweep angle specified in degrees, if toXOrRectangle is a gpRectangle object.

tnH, numeric, the height of bounding rectangle, when toXOrRectangle is numeric.

tnStart, numeric, the starting angle specified in degrees, when toXOrRectangle is numeric.

tnSweep, numeric, the sweep angle specified in degrees, when toXOrRectangle is numeric.

FillPolygon Method

Fills a polygon defined by a set of points in a Visual FoxPro array.

Syntax: THIS.FillPolygon(toBrush, taPoints[, tnFirstCol[, tnFillMode]])

Return Values: Logical, representing success or failure.

Parameters: 

toBrush, required, the gpBrush to use.

taPoints, required, an array containing coordinates of the points. The array has one row for each point, and must have at least two columns, with taArray[i, tnFirstCol] containing the X-coordinate and taArray[i,tnFirstCol+1] containing the Y-coordinate.

tnFirstCol, optional, the integer column index of the X-coordinate. Defaults to 1.

tnFillMode, optional, the fill mode as defined by the GDIPLUS_FillMode_* constants. Default value is GDIPLUS_FillMode_Alternate.

FillPolygonFromCursor Method

Fills a polygon defined by a set of points in a Visual FoxPro cursor.

Syntax: THIS.FillPolygonFromCursor(toBrush, tcAlias, tcExprX, tcExprY[, tnFillMode])

Return Values: Logical, representing success or failure.

Parameters: 

toBrush, required, gpBrush to use.

tcAlias, required, alias of cursor containing coordinates of the points, one row for each point.

tcExprX, required, string, expression to evaluate for X-coordinate (must evaluate to numeric).

tcExprY, required, string, expression to evaluate for Y-coordinate (must evaluate to numeric).

tnFillMode, optional, the fill mode as defined by the GDIPLUS_FillMode_* constants. Default value is GDIPLUS_FillMode_Alternate.

FillRectangle Method

Fills a rectangle, defined either by a gpRectangle object, or by separate coordinates and dimension parameters.

Syntax: THIS.FillRectangle(toBrush, tXOrRect[,tnY,tnW,tnH])

Return Values: Logical, representing success or failure.

toBrush, required, gpBrush to use.

tXOrRectangle, either a gpRectangle object specifying bounding rectangle or a numeric value specifying the X-coordinate of top-left corner of bounding rectangle

tnY, numeric, Y-coordinate of top-left corner of bounding rectangle. Required if tXorRectangle is numeric.

tnW, numeric, width of bounding rectangle. Required if tXorRectangle is numeric.

tnH, numeric, height of bounding rectangle. Required if tXorRectangle is numeric.

FillRectangles Method

Fills a set of rectangles defined by coordinates in a Visual FoxPro array.

Syntax: THIS.FillRectangles(toBrush, taRects[, tnFirstCol])

Return Values: Logical, representing success or failure.

Parameters: 

toBrush, required, the gpBrush to use.

taRects, required, an array containing coordinates of points defining the rectangles. The array has one row for each rectangle, and must have at least two columns, with taArray[i, tnFirstCol] containing the X-coordinate, taArray[i,tnFirstCol+1] containing the Y-coordinate, aArray[i, tnFirstCol+2] containing the width, and taArray[i,tnFirstCol+3] containing the height.

tnFirstCol, optional, the integer column index of the X-coordinate. Defaults to 1.

FillRectanglesFromCursor Method

Fills a set of rectangles defined in a Visual FoxPro cursor.

Syntax: THIS.FillRectanglesFromCursor(toBrush, tcAlias, tcExprX, tcExprY, tcExprW, tcExprH)

Return Values: Logical, representing success or failure.

Parameters: 

toBrush, required, gpBrush to use.

tcAlias, required, alias of cursor containing coordinates of the points, one row for each rectangle.

tcExprX, required, string, expression to evaluate for X-coordinate (must evaluate to numeric).

tcExprY, required, string, expression to evaluate for Y-coordinate (must evaluate to numeric).

tcExprW, required, string, expression to evaluate for width (must evaluate to numeric).

tcExprH, required, string, expression to evaluate for height (must evaluate to numeric).

Flush Method

Forces immediate processing of all pending graphics operations.

Syntax: THIS.Flush(tnFlushIntention)

Return Values: Logical, representing success or failure.

Parameters: 

tnFlushIntention, required, numeric values defined in GDIPLUS_FlushIntention_* constants.

GetHdc Method

Obtains a Windows device context handle to enable drawing on the gpGraphics surface with Windows GDI functions.

Syntax: hDC = THIS.GetHdc()

Return Values: Integer handle to the GDI device context, or null (.NULL.) on error.

Parameters:  none.

Remarks: This method is equivalent to the .NET Graphics.GetHdc. The handle must be released with ReleaseHdc() after use.

InterpolationMode Property

Specifies the interpolation mode associated with this graphics object.

Default: Empty.

MeasureStringA Method

Measures ANSI text string when drawn with the specified font and formatting.

Syntax: THIS.MeasureStringA(tcAnsiString,[toFont,[tvLayoutArea, [toStringFormat,[@rnCharsFitted[,@rnLinesFilled]]]])

Return Values: a gpSize object indicating the bounding rectangle of the string. Returns null (.NULL.) on error.

Parameters: 

tcAnsiString, required, the ANSI string to measure.

toFont, optional, a gpFont object specified font to measure in.

tvLayoutArea, optional, a gpRectangle or gpSize object to within which text should be laid out.

toStringFormat, optional, a gpStringFormat object

rnCharsFitted, optional, on return is set to the number of characters that fit into the layout rectangle.

rnLinesFilled, optional, on return is set to the number of lines that fit into the layout rectangle.

Remarks: Note that the area of the gpSize object provided as a return value may be larger than a layout rectangle supplied to the method as the tvLayoutArea parameter.

MeasureStringW Method

Measures Unicode text string when drawn with the specified font and formatting.

Syntax: THIS.MeasureStringW(tcUnicodeString,[toFont,[tvLayoutArea, [toStringFormat,[@rnCharsFitted[,@rnLinesFilled]]]])

Return Values: a gpSize object indicating the bounding rectangle of the string. Returns null (.NULL.) on error.

Parameters: 

tcUnicodeString, required, the Unicode string to measure.

toFont, optional, a gpFont object specified font to measure in.

tvLayoutArea, optional, a gpRectangle or gpSize object to within which text should be laid out.

toStringFormat, optional, a gpStringFormat object

rnCharsFitted, optional, on return is set to the number of characters that fit into the layout rectangle.

rnLinesFilled, optional, on return is set to the number of lines that fit into the layout rectangle.

Remarks: Note that the area of the gpSize object provided as a return value may be larger than a layout rectangle supplied to the method as the tvLayoutArea parameter.

PageScale Property

Specifies the scaling between world units and page units.

Default: Empty.

PageUnit Property

Specifies the unit of measure used for page coordinates, as defined in GDIPLUS_Unit_* constants. Read-write.

Default: Empty.

PixelOffsetMode Property

Specifies how pixels are offset during rendering, using values indicated by GDIPLUS_PixelOffsetMode_* defined constants.

Default: 0.

ReleaseHdc Method

Releases a device context handle previously obtained with GetHDC() method.

Syntax: THIS.ReleaseHDC(tnHDC)

Return Values: Logical, representing success or failure.

Parameters: 

tnHDC, required, integer device context handle.

Remarks: This method is equivalent to the .NET Graphics.ReleaseHdc.

RenderingOrigin Property

The rendering origin for dithering and for hatch brushes, represented as a gpPoint object. Read-write.

Default: Empty.

ResetTransform Method

Resets the world transform matrix (to no transformation).

Syntax: THIS.ResetTransform()

Return Values: Logical, representing success or failure.

Parameters:  none.

Restore Method

Restores previously saved graphics state.

Syntax: ? THIS.Restore(tnGraphicsState)

Return Values: Logical, representing success or failure.

Parameters: 

tnGraphicsState, required, an integer graphics state handle previously obtained through the Save() method.

RotateTransform Method

Prepends rotation by specified angle to this object's transformation matrix.

Syntax: THIS.RotateTransform(tnAngle[, tnMatrixOrder])

Return Values: Logical, representing success or failure.

Parameters: 

tnAngle, required, a rotation angle in degrees.

tnMatrixOrder, optional, the order of insertion into transformation matrix, as specified in GDIPLUS_MatrixOrder_* defined constants.

Save Method

Saves current graphics state and returns a token (for later restore).

Syntax: THIS.Save(@rnGraphicsState)

Return Values: Logical, representing success or failure.

Parameters: 

rnGraphicsState, required, on return is set to a graphics state handle which can be passed to the Restore() method.

ScaleTransform Method

Applies scaling to transformation matrix for this graphics object.

Syntax: THIS.ScaleTransform(tnScaleX, tnScaleY[, tnMatrixOrder])

Return Values: Logical, representing success or failure.

Parameters: 

tnScaleX, required, the horizontal scaling factor.

tnScaleY, required, the vertical scaling factor.

tnMatrixOrder, optional, the order of insertion into transformation matrix, as specified in GDIPLUS_MatrixOrder_* defined constants.

SmoothingMode Property

Specifies rendering quality, with possible values indicated by GDIPLUS_SmoothingMode_* constants.

Default: Empty.

TextContrast Property

Specifies gamma correction value for rendering text.

Default: Empty.

TextRenderingHint Property

Specifies the rendering mode for text associated with this graphics object.

Default: Empty.

TranslateTransform Method

Adds translation by (x,y) to this graphics object's transformation matrix.

Syntax: THIS.TranslateTransform(tnOffsetX, tnOffsetY[, tnMatrixOrder])

Return Values: Logical, representing success or failure.

Parameters: 

tnOffsetX, required, the horizontal offset value.

tnOffsetY, required, the vertical offset value.

tnMatrixOrder, optional, the order of insertion into transformation matrix, as specified in GDIPLUS_MatrixOrder_* defined constants

VisibleClipBounds Property

Visible clipping region represented as a gpRectangle object. Read-only.

Default: Empty.

See Also

Concepts

Guidelines for Using Visual FoxPro Foundation Classes

Reference

Visual FoxPro Foundation Classes A-Z

GDI Plus API Wrapper Foundation Classes