GDI Plus Graphics Foundation Class
Visual FoxPro 9.0 SP2 |
GDI Plus Graphics Foundation Class |
See Also |
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:
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:
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:
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:
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:
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:
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:
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
tnFirstCol, optional, integer column index of the X-coordinate. Defaults to |
DrawBeziersFromCursor Method |
Draws a series of Bézier splines, given a set of points defined in a Visual FoxPro cursor.
Syntax:
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:
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
tnFirstCol, optional. Integer column index of the X-coordinate. Defaults to |
DrawClosedCurveFromCursor Method |
Draws a closed curve through a set of points defined in a Visual FoxPro cursor.
Syntax:
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:
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
tnFirstCol, optional. Integer column index of the X-coordinate. Defaults to |
DrawCurveFromCursor Method |
Draws a curve through a set of points defined in a Visual FoxPro cursor.
Syntax:
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:
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:
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:
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:
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:
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:
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:
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
tnFirstCol, optional, an integer column index of the X-coordinate. Defaults to |
DrawLinesFromCursor Method |
Draws a sequence of connected lines, given the endpoints of each line in a Visual FoxPro cursor.
Syntax:
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:
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:
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
tnFirstCol, optional, the integer column index of the X-coordinate. Defaults to |
DrawPolygonFromCursor Method |
Draws a polygon defined by a set of points provided in a VisualFoxPro cursor.
Syntax:
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:
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:
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
tnFirstCol, optional, the integer column index of the X-coordinate. Defaults to |
DrawRectanglesFromCursor Method |
Draws a set of outlined rectangles, given coordinates in a Visual FoxPro cursor.
Syntax:
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:
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:
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:
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
tnFirstCol, optional, integer column index of the X-coordinate. Defaults to
tnFillMode, optional, the fill mode as defined by the GDIPLUS_FillMode_* constants. Default value is |
FillClosedCurveFromCursor Method |
Fills a closed curve as defined by a set of points in a Visual FoxPro cursor.
Syntax:
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 |
FillEllipse Method |
Draws a filled ellipse specified by its bounding rectangle.
Syntax:
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:
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:
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
tnFirstCol, optional, the integer column index of the X-coordinate. Defaults to
tnFillMode, optional, the fill mode as defined by the GDIPLUS_FillMode_* constants. Default value is |
FillPolygonFromCursor Method |
Fills a polygon defined by a set of points in a Visual FoxPro cursor.
Syntax:
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 |
FillRectangle Method |
Fills a rectangle, defined either by a gpRectangle object, or by separate coordinates and dimension parameters.
Syntax:
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:
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
tnFirstCol, optional, the integer column index of the X-coordinate. Defaults to |
FillRectanglesFromCursor Method |
Fills a set of rectangles defined in a Visual FoxPro cursor.
Syntax:
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:
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:
Return Values: Integer handle to the GDI device context, or null ( Parameters: none.
Remarks: This method is equivalent to the .NET |
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:
Return Values: a gpSize object indicating the bounding rectangle of the string. Returns null ( 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:
Return Values: a gpSize object indicating the bounding rectangle of the string. Returns null ( 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: |
ReleaseHdc Method |
Releases a device context handle previously obtained with GetHDC() method.
Syntax:
Return Values: Logical, representing success or failure. Parameters: tnHDC, required, integer device context handle.
Remarks: This method is equivalent to the .NET |
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:
Return Values: Logical, representing success or failure. Parameters: none. |
Restore Method |
Restores previously saved graphics state.
Syntax:
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:
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:
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:
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:
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
Send feedback on this topic to the VFPX Help file project team.
2009-2017 Placed under Creative Commons licensing by Microsoft Corporation.
© , 1996-2020 • Updated: 11/10/20
Comment or report problem with topic