Home COM GDI+ WebBrowser Data Access 

Graphics Functions (GDI+)

 

 

The Graphics functions provide methods for drawing lines, curves, figures, images, and text. A Graphics object stores attributes of the display device and attributes of the items to be drawn.

 

Return Values

If the function succeeds, it returns Ok, which is an element of the Status enumeration.

 

If the function fails, it returns one of the other elements of the Status enumeration.

 

GdipDeleteGraphics

 

Description

Deletes the specified Graphics object.

Syntax

GpStatus WINGDIPAPI GdipDeleteGraphics(

    GpGraphics *graphics

);

PowerBASIC Syntax

DECLARE FUNCTION GdipDeleteGraphics ( _

    BYVAL graphics AS DWORD _

) AS LONG

Parameters

 

graphics

[in] Pointer to the Graphics object.

 

GdipDrawArc

 

Description

Draws an arc. The arc is part of an ellipse.

Syntax

GpStatus WINGDIPAPI GdipDrawArc(

    GpGraphics *graphics,

    GpPen *pen,

    REAL x,

    REAL y,

    REAL width,

    REAL height,

    REAL startAngle,

    REAL sweepAngle

);

PowerBASIC Syntax

DECLARE FUNCTION GdipDrawArc ( _

    BYVAL graphics AS DWORD, _

    BYVAL pen AS DWORD, _

    BYVAL x AS SINGLE, _

    BYVAL y AS SINGLE, _

    BYVAL nWidth AS SINGLE, _

    BYVAL nHeight AS SINGLE, _

    BYVAL startAngle AS SINGLE, _

    BYVAL sweepAngle AS SINGLE _

) AS LONG

Parameters

 

graphics

[in] Pointer to the Graphics object.

pen

[in] Pointer to a pen that is used to draw the arc.

x

[in] Simple precision value that specifies the x-coordinate of the upper-left corner of the bounding rectangle for the ellipse that contains the arc.

y

[in] Simple precision value that specifies the y-coordinate of the upper-left corner of the bounding rectangle for the ellipse that contains the arc.

width

[in] Simple precision value that specifies the width of the ellipse that contains the arc.

height

[in] Simple precision value that specifies the height of the ellipse that contains the arc.

startAngle

[in] Simple precision value that specifies the angle between the x-axis and the starting point of the arc.

sweepAngle

[in] Simple precision value that specifies the angle between the starting and ending points of the arc.

 

GdipDrawArcI

 

Description

Draws an arc. The arc is part of an ellipse.

Syntax

GpStatus WINGDIPAPI GdipDrawArcI(

    GpGraphics *graphics,

    GpPen *pen,

    INT x,

    INT y,

    INT width,

    INT height,

    REAL startAngle,

    REAL sweepAngle

);

PowerBASIC Syntax

DECLARE FUNCTION GdipDrawArcI ( _

    BYVAL graphics AS DWORD, _

    BYVAL pen AS DWORD, _

    BYVAL x AS LONG, _

    BYVAL y AS LONG, _

    BYVAL nWidth AS LONG, _

    BYVAL nHeight AS LONG, _

    BYVAL startAngle AS SINGLE, _

    BYVAL sweepAngle AS SINGLE _

) AS LONG

Parameters

 

graphics

[in] Pointer to the Graphics object.

pen

[in] Pointer to a pen that is used to draw the arc.

x

[in] Long integer value that specifies the x-coordinate of the upper-left corner of the bounding rectangle for the ellipse that contains the arc.

y

[in]  Long integer value that specifies the y-coordinate of the upper-left corner of the bounding rectangle for the ellipse that contains the arc.

width

[in]  Long integer value that specifies the width of the ellipse that contains the arc.

height

[in]  Long integer value that specifies the height of the ellipse that contains the arc.

startAngle

[in] Simple precision value that specifies the angle between the x-axis and the starting point of the arc.

sweepAngle

[in] Simple precision value that specifies the angle between the starting and ending points of the arc.

 

GdipDrawBezier

 

Description

Draws a Bezier spline.

Syntax

GpStatus WINGDIPAPI GdipDrawBezier(

    GpGraphics *graphics,

    GpPen *pen,

    REAL x1,

    REAL y1,

    REAL x2,

    REAL y2,

    REAL x3,

    REAL y3,

    REAL x4,

    REAL y4

);

PowerBASIC Syntax

DECLARE FUNCTION GdipDrawBezier ( _

    BYVAL graphics AS DWORD, _

    BYVAL pen AS DWORD, _

    BYVAL x1 AS SINGLE, _

    BYVAL x1 AS SINGLE, _

    BYVAL x2 AS SINGLE, _

    BYVAL x2 AS SINGLE, _

    BYVAL x3 AS SINGLE, _

    BYVAL x3 AS SINGLE, _

    BYVAL x4 AS SINGLE, _

    BYVAL x4 AS SINGLE, _

) AS LONG

Parameters

 

graphics

[in] Pointer to the Graphics object.

pen

[in] Pointer to a pen that is used to draw the Bezier spline.

x1

[in] Simple precision value that specifies the x-coordinate of the starting point of the Bezier spline.

y1

[in] Simple precision value that specifies the y-coordinate of the starting point of the Bezier spline.

x2

[in] Simple precision value that specifies the x-coordinate of the first control point of the Bezier spline.

y2

[in] Simple precision value that specifies the y-coordinate of the first control point of the Bezier spline

x3

[in] Simple precision value that specifies the x-coordinate of the second control point of the Bezier spline.

y3

[in] Simple precision value that specifies the y-coordinate of the second control point of the Bezier spline.

x4

[in] Simple precision value that specifies the x-coordinate of the ending point of the Bezier spline.

y4

[in] Simple precision value that specifies the y-coordinate of the ending point of the Bezier spline

Remarks

A Bezier spline does not pass through its control points. The control points act as magnets, pulling the curve in certain directions to influence the way the Bezier spline bends.

 

GdipDrawBezierI

 

Description

Draws a Bezier spline.

Syntax

GpStatus WINGDIPAPI GdipDrawBezierI(

    GpGraphics *graphics,

    GpPen *pen,

    INT x1,

    INT y1,

    INT x2,

    INT y2,

    INT x3,

    INT y3,

    INT x4,

    INT y4

);

PowerBASIC Syntax

DECLARE FUNCTION GdipDrawBezierI ( _

    BYVAL graphics AS DWORD, _

    BYVAL pen AS DWORD, _

    BYVAL x1 AS LONG, _

    BYVAL y1 AS LONG, _

    BYVAL x2 AS LONG, _

    BYVAL y2 AS LONG, _

    BYVAL x3 AS LONG, _

    BYVAL y3 AS LONG, _

    BYVAL x4 AS LONG, _

    BYVAL y4 AS LONG _

) AS LONG

Parameters

 

graphics

[in] Pointer to the Graphics object.

pen

[in] Pointer to a pen that is used to draw the Bezier spline.

x1

[in] Long integer value that specifies the x-coordinate of the starting point of the Bezier spline.

y1

[in] Long integer value that specifies the y-coordinate of the starting point of the Bezier spline.

x2

[in] Long integer value that specifies the x-coordinate of the first control point of the Bezier spline.

y2

[in] Long integer value that specifies the y-coordinate of the first control point of the Bezier spline

x3

[in] Long integer value that specifies the x-coordinate of the second control point of the Bezier spline.

y3

[in] Long integer value that specifies the y-coordinate of the second control point of the Bezier spline.

x4

[in] Long integer value that specifies the x-coordinate of the ending point of the Bezier spline.

y4

[in] Long integer value that specifies the y-coordinate of the ending point of the Bezier spline

Remarks

A Bezier spline does not pass through its control points. The control points act as magnets, pulling the curve in certain directions to influence the way the Bezier spline bends.

 

GdipDrawBeziers

 

Description

Draws a sequence of connected Bezier splines.

Syntax

GpStatus WINGDIPAPI GdipDrawBeziers(

    GpGraphics *graphics,

    GpPen *pen,

    GDIPCONST GpPointF *points,

    INT count

);

PowerBASIC Syntax

DECLARE FUNCTION GdipDrawBeziers ( _

    BYVAL graphics AS DWORD, _

    BYVAL pen AS DWORD, _

    BYREF pPoints AS PointF, _

    BYVAL count AS LONG _

) AS LONG

Parameters

 

graphics

[in] Pointer to the Graphics object.

pen

[in] Pointer to a pen that is used to draw the Bezier splines.

points

[in] Pointer to an array of PointF structures that specify the starting, ending, and control points of the Bezier splines.

count

[in] Integer that specifies the number of elements in the points array.

Remarks

A Bezier spline does not pass through its control points. The control points act as magnets, pulling the curve in certain directions to influence the way a Bezier spline bends. Each Bezier spline requires a starting point and an ending point. Each ending point is the starting point for the next Bezier spline.

 

GdipDrawBeziersI

 

Description

Draws a sequence of connected Bezier splines.

Syntax

GpStatus WINGDIPAPI GdipDrawBeziersI(

    GpGraphics *graphics,

    GpPen *pen,

    GDIPCONST GpPoint *points,

    INT count

);

PowerBASIC Syntax

DECLARE FUNCTION GdipDrawBeziersI ( _

    BYVAL graphics AS DWORD, _

    BYVAL pen AS DWORD, _

    BYREF pPoints AS PointL, _

    BYVAL count AS LONG, _

) AS LONG

Parameters

 

graphics

[in] Pointer to the Graphics object.

pen

[in] Pointer to a pen that is used to draw the Bezier splines.

points

[in] Pointer to an array of PointL objects that specify the starting, ending, and control points of the Bezier splines. The ending coordinate of one Bezier spline is the starting coordinate of the next Bezier spline.

count

[in] Integer that specifies the number of elements in the points array.

Remarks

A Bezier spline does not pass through its control points. The control points act as magnets, pulling the curve in certain directions to influence the way the Bezier splines bend.

 

GdipDrawClosedCurve

 

Description

Draws a closed cardinal spline.

Syntax

GpStatus WINGDIPAPI GdipDrawClosedCurve(

    GpGraphics *graphics,

    GpPen *pen,

    GDIPCONST GpPointF *points,

    INT count

);

PowerBASIC Syntax

DECLARE FUNCTION GdipDrawClosedCurve ( _

    BYVAL graphics AS DWORD, _

    BYVAL pen AS DWORD, _

    BYREF pPoints AS PointF, _

    BYVAL count AS LONG _

) AS LONG

Parameters

 

graphics

[in] Pointer to the Graphics object.

pen

[in] Pointer to a pen that is used to draw the Bezier splines.

points

[in] Pointer to an array of PointF structures that specify the coordinates of the closed cardinal spline. The array of PointF structures must contain a minimum of three elements.

count

[in] Long integer value that specifies the number of elements in the points array.

Remarks

Each ending point is the starting point for the next cardinal spline. In a closed cardinal spline, the curve continues through the last point in the points array and connects with the first point in the array.

 

GdipDrawClosedCurve2

 

Description

Draws a closed cardinal spline.

Syntax

GpStatus WINGDIPAPI GdipDrawClosedCurve2(

    GpGraphics *graphics,

    GpPen *pen,

    GDIPCONST GpPointF *points,

    INT count,

    REAL tension

);

PowerBASIC Syntax

DECLARE FUNCTION GdipDrawClosedCurve2 ( _

    BYVAL graphics AS DWORD, _

    BYVAL pen AS DWORD, _

    BYREF pPoints AS PointF, _

    BYVAL count AS LONG, _

    BYVAL tension AS SINGLE _

) AS LONG

Parameters

 

graphics

[in] Pointer to the Graphics object.

pen

[in] Pointer to a pen that is used to draw the Bezier splines.

points

[in] Pointer to an array of PointF structures that specify the coordinates of the closed cardinal spline. The array of PointF structures must contain a minimum of three elements.

count

[in] Long integer value that specifies the number of elements in the points array.

tension

[in] Simple precision value that specifies how tightly the curve bends though the coordinates of the closed cardinal spline.

Remarks

Each ending point is the starting point for the next cardinal spline. In a closed cardinal spline, the curve continues through the last point in the points array and connects with the first point in the array.

 

GdipDrawClosedCurve2I

 

Description

Draws a closed cardinal spline.

Syntax

GpStatus WINGDIPAPI GdipDrawClosedCurve2I(

    GpGraphics *graphics,

    GpPen *pen,

    GDIPCONST GpPoint *points,

    INT count,

    REAL tension

);

PowerBASIC Syntax

DECLARE FUNCTION GdipDrawClosedCurve2I ( _

    BYVAL graphics AS DWORD, _

    BYVAL pen AS DWORD, _

    BYREF pPoints AS PointL, _

    BYVAL count AS LONG, _

    BYVAL tension AS SINGLE _

) AS LONG

Parameters

 

graphics

[in] Pointer to the Graphics object.

pen

[in] Pointer to a pen that is used to draw the Bezier splines.

points

[in] Pointer to an array of PointL structures that specify the coordinates of the closed cardinal spline. The array of PointL structures must contain a minimum of three elements.

count

[in] Long integer value that specifies the number of elements in the points array.

tension

[in] Simple precision value that specifies how tightly the curve bends though the coordinates of the closed cardinal spline.

Remarks

Each ending point is the starting point for the next cardinal spline. In a closed cardinal spline, the curve continues through the last point in the points array and connects with the first point in the array.

 

GdipDrawClosedCurveI

 

Description

Draws a closed cardinal spline.

Syntax

GpStatus WINGDIPAPI GdipDrawClosedCurveI(

    GpGraphics *graphics,

    GpPen *pen,

    GDIPCONST GpPoint *points,

    INT count

);

PowerBASIC Syntax

DECLARE FUNCTION GdipDrawClosedCurveI ( _

    BYVAL graphics AS DWORD, _

    BYVAL pen AS DWORD, _

    BYREF pPoints AS PointL, _

    BYVAL count AS LONG _

) AS LONG

Parameters

 

graphics

[in] Pointer to the Graphics object.

pen

[in] Pointer to a pen that is used to draw the Bezier splines.

points

[in] Pointer to an array of PointL structures that specify the coordinates of the closed cardinal spline. The array of PointL  structures must contain a minimum of three elements.

count

[in] Long integer value that specifies the number of elements in the points array.

Remarks

In a closed cardinal spline, the curve continues through the last point in the points array and connects with the first point in the array.

 

GdipDrawCurve

 

Description

Draws a cardinal spline.

Syntax

GpStatus WINGDIPAPI GdipDrawCurve(

    GpGraphics *graphics,

    GpPen *pen,

    GDIPCONST GpPointF *points,

    INT count

);

PowerBASIC Syntax

DECLARE FUNCTION GdipDrawCurve ( _

    BYVAL graphics AS DWORD, _

    BYVAL pen AS DWORD, _

    BYREF pPoints AS PointF, _

    BYVAL count AS LONG _

) AS LONG

Parameters

 

graphics

[in] Pointer to the Graphics object.

pen

[in] Pointer to a pen that is used to draw the Bezier splines.

points

[in] Pointer to an array of PointF structures that specify the coordinates that the cardinal spline passes through.

count

[in] Long integer value that specifies the number of elements in the points array.

Remarks

A segment is defined as a curve that connects two consecutive points in the cardinal spline. The ending point of each segment is the starting point for the next.

 

GdipDrawCurve2

 

Description

Draws a cardinal spline.

Syntax

GpStatus WINGDIPAPI GdipDrawCurve2(

    GpGraphics *graphics,

    GpPen *pen,

    GDIPCONST GpPointF *points,

    INT count,

    REAL tension

);

PowerBASIC Syntax

DECLARE FUNCTION GdipDrawCurve2 ( _

    BYVAL graphics AS DWORD, _

    BYVAL pen AS DWORD, _

    BYREF pPoints AS PointF, _

    BYVAL count AS LONG, _

    BYVAL tension AS SINGLE _

) AS LONG

Parameters

 

graphics

[in] Pointer to the Graphics object.

pen

[in] Pointer to a pen that is used to draw the Bezier splines.

points

[in] Pointer to an array of PointF structures that specify the coordinates that the cardinal spline passes through.

count

[in] Long integer value that specifies the number of elements in the points array.

tension

[in] Simple precision value that specifies how tightly the curve bends though the coordinates of the cardinal spline.

Remarks

A segment is defined as a curve that connects two consecutive points in the cardinal spline. The ending point of each segment is the starting point for the next.

 

GdipDrawCurve2I

 

Description

Draws a cardinal spline.

Syntax

GpStatus WINGDIPAPI GdipDrawCurve2I(

    GpGraphics *graphics,

    GpPen *pen,

    GDIPCONST GpPoint *points,

    INT count,