Pen Functions
Windows GDI+ exposes a flat API that consists of about 600 functions, which are implemented in Gdiplus.dll and declared in Gdiplusflat.h. The functions in the GDI+ flat API are wrapped by a collection of about 40 C++ classes. It is recommended that you do not directly call the functions in the flat API. Whenever you make calls to GDI+, you should do so by calling the methods and functions provided by the C++ wrappers. Microsoft Product Support Services will not provide support for code that calls the flat API directly. For more information on using these wrapper methods, see GDI+ Flat API.
The following flat API functions are wrapped by the Pen C++ class.
Pen Functions and Corresponding Wrapper Methods
| Flat function | Wrapper method | Remarks |
|---|---|---|
|
GpStatus WINGDIPAPI GdipCreatePen1(ARGB color, REAL width, GpUnit unit, GpPen **pen) |
Creates a Pen object that uses a specified color and width. The unit parameter of the flat function is a member of the Unit enumeration that specifies the unit of measure for the width of the pen. | |
|
GpStatus WINGDIPAPI GdipCreatePen2(GpBrush *brush, REAL width, GpUnit unit, GpPen **pen) |
Creates a Pen object that uses the attributes of a brush and a real number to set the width of this Pen object. The unit parameter of the flat function is a member of the Unit enumeration that specifies the unit of measure for the width of the pen. | |
|
GpStatus WINGDIPAPI GdipClonePen(GpPen *pen, GpPen **clonepen) | Copies a Pen object. | |
|
GpStatus WINGDIPAPI GdipDeletePen(GpPen *pen) |
Pen::~Pen() | Releases resources used by the Pen object. |
|
GpStatus WINGDIPAPI GdipSetPenWidth(GpPen *pen, REAL width) | Sets the width for this Pen object. | |
|
GpStatus WINGDIPAPI GdipGetPenWidth(GpPen *pen, REAL *width) | Gets the width currently set for this Pen object. | |
|
GpStatus WINGDIPAPI GdipSetPenUnit(GpPen *pen, GpUnit unit) |
Not called by wrapper methods. |
This function sets the unit of measure for the pen specified by the pen parameter to the value specified by the unit parameter. The unit parameter is a member of the Unit enumeration that specifies the unit of measure for the width of the pen. |
|
GpStatus WINGDIPAPI GdipGetPenUnit(GpPen *pen, GpUnit *unit) |
Not called by wrapper methods. |
This function gets the unit of measure for the pen specified by the pen parameter. The unit parameter receives a member of the Unit enumeration that indicates the unit of measure for the width of the pen. |
|
GpStatus WINGDIPAPI GdipSetPenLineCap197819(GpPen *pen, GpLineCap startCap, GpLineCap endCap, GpDashCap dashCap) |
Status Pen::SetLineCap(IN LineCap startCap, IN LineCap endCap, IN DashCap dashCap) | Sets the cap styles for the start, end, and dashes in a line drawn with this pen. |
|
GpStatus WINGDIPAPI GdipSetPenStartCap(GpPen *pen, GpLineCap startCap) | Sets the start cap for this Pen object. | |
|
GpStatus WINGDIPAPI GdipSetPenEndCap(GpPen *pen, GpLineCap endCap) | Sets the end cap for this Pen object. | |
|
GpStatus WINGDIPAPI GdipSetPenDashCap197819(GpPen *pen, GpDashCap dashCap) | Sets the dash cap style for this Pen object. | |
|
GpStatus WINGDIPAPI GdipGetPenStartCap(GpPen *pen, GpLineCap *startCap) | Gets the start cap currently set for this Pen object. | |
|
GpStatus WINGDIPAPI GdipGetPenEndCap(GpPen *pen, GpLineCap *endCap) | Gets the end cap currently set for this Pen object. | |
|
GpStatus WINGDIPAPI GdipGetPenDashCap197819(GpPen *pen, GpDashCap *dashCap) | Gets the dash cap style currently set for this Pen object. | |
|
GpStatus WINGDIPAPI GdipSetPenLineJoin(GpPen *pen, GpLineJoin lineJoin) | Sets the line join for this Pen object. | |
|
GpStatus WINGDIPAPI GdipGetPenLineJoin(GpPen *pen, GpLineJoin *lineJoin) | Gets the line join for this Pen object. | |
|
GpStatus WINGDIPAPI GdipSetPenCustomStartCap(GpPen *pen, GpCustomLineCap* customCap) |
Status Pen::SetCustomStartCap(IN const CustomLineCap* customCap) | Sets the custom start cap for this Pen object. |
|
GpStatus WINGDIPAPI GdipGetPenCustomStartCap(GpPen *pen, GpCustomLineCap** customCap) | Gets the custom start cap for this Pen object. | |
|
GpStatus WINGDIPAPI GdipSetPenCustomEndCap(GpPen *pen, GpCustomLineCap* customCap) |
Status Pen::SetCustomEndCap(IN const CustomLineCap* customCap) | Sets the custom end cap currently set for this Pen object |
|
GpStatus WINGDIPAPI GdipGetPenCustomEndCap(GpPen *pen, GpCustomLineCap** customCap) |
Status Pen::GetCustomEndCap(OUT CustomLineCap* customCap) const | Gets the custom end cap currently set for this Pen object |
|
GpStatus WINGDIPAPI GdipSetPenMiterLimit(GpPen *pen, REAL miterLimit) | Sets the miter length currently set for this Pen object. | |
|
GpStatus WINGDIPAPI GdipGetPenMiterLimit(GpPen *pen, REAL *miterLimit) | Gets the miter length currently set for this Pen object. | |
|
GpStatus WINGDIPAPI GdipSetPenMode(GpPen *pen, GpPenAlignment penMode) | Sets the alignment currently set for this Pen object. | |
|
GpStatus WINGDIPAPI GdipGetPenMode(GpPen *pen, GpPenAlignment *penMode) | Sets the alignment currently set for this Pen object. | |
|
GpStatus WINGDIPAPI GdipSetPenTransform(GpPen *pen, GpMatrix *matrix) | Sets the world transformation matrix currently set for this Pen object. | |
|
GpStatus WINGDIPAPI GdipGetPenTransform(GpPen *pen, GpMatrix *matrix) | Gets the world transformation matrix currently set for this Pen object. | |
|
GpStatus WINGDIPAPI GdipResetPenTransform(GpPen *pen) | Sets the world transformation matrix of this Pen object to the identity matrix. | |
|
GpStatus WINGDIPAPI GdipMultiplyPenTransform(GpPen *pen, GDIPCONST GpMatrix *matrix, GpMatrixOrder order) |
Status Pen::MultiplyTransform(IN const Matrix* matrix, IN MatrixOrder order = MatrixOrderPrepend) | Updates the world transformation matrix of this Pen object with the product of itself and another matrix. |
|
GpStatus WINGDIPAPI GdipTranslatePenTransform(GpPen *pen, REAL dx, REAL dy, GpMatrixOrder order) |
Not called by wrapper methods. | |
|
GpStatus WINGDIPAPI GdipScalePenTransform(GpPen *pen, REAL sx, REAL sy, GpMatrixOrder order) |
Status Pen::ScaleTransform(IN REAL sx, IN REAL sy, IN MatrixOrder order = MatrixOrderPrepend) | Sets the Pen object's world transformation matrix equal to the product of itself and a scaling matrix. |
|
GpStatus WINGDIPAPI GdipRotatePenTransform(GpPen *pen, REAL angle, GpMatrixOrder order) |
Status Pen::RotateTransform(IN REAL angle, IN MatrixOrder order = MatrixOrderPrepend) | Updates the world transformation matrix of this Pen object with the product of itself and a rotation matrix. |
|
GpStatus WINGDIPAPI GdipSetPenColor(GpPen *pen, ARGB argb) | Sets the color for this Pen object. | |
|
GpStatus WINGDIPAPI GdipGetPenColor(GpPen *pen, ARGB *argb) | Gets the color for this Pen object. | |
|
GpStatus WINGDIPAPI GdipSetPenBrushFill(GpPen *pen, GpBrush *brush) | Sets the Brush object that a pen uses to fill a line. | |
|
GpStatus WINGDIPAPI GdipGetPenBrushFill(GpPen *pen, GpBrush **brush) | Gets the Brush object that a pen uses to fill a line. | |
|
GpStatus WINGDIPAPI GdipGetPenFillType(GpPen *pen, GpPenType* type) | Gets the type currently set for this Pen object. | |
|
GpStatus WINGDIPAPI GdipGetPenDashStyle(GpPen *pen, GpDashStyle *dashstyle) | Gets the dash style currently set for this Pen object. | |
|
GpStatus WINGDIPAPI GdipSetPenDashStyle(GpPen *pen, GpDashStyle dashstyle) | Sets the dash style currently set for this Pen object. | |
|
GpStatus WINGDIPAPI GdipGetPenDashOffset(GpPen *pen, REAL *offset) | Gets the distance from the start of the line to the start of the first space in a dashed line. | |
|
GpStatus WINGDIPAPI GdipSetPenDashOffset(GpPen *pen, REAL offset) | Sets the distance from the start of the line to the start of the first space in a dashed line. | |
|
GpStatus WINGDIPAPI GdipGetPenDashCount(GpPen *pen, INT *count) | Gets the number of elements in a dash pattern array. | |
|
GpStatus WINGDIPAPI GdipSetPenDashArray(GpPen *pen, GDIPCONST REAL *dash, INT count) |
Status Pen::SetDashPattern(IN const REAL* dashArray, IN INT count) | Sets an array of custom dashes and spaces currently set for this Pen object. |
|
GpStatus WINGDIPAPI GdipGetPenDashArray(GpPen *pen, REAL *dash, INT count) |
Status Pen::GetDashPattern(OUT REAL* dashArray, IN INT count) const | Gets an array of custom dashes and spaces currently set for this Pen object. |
|
GpStatus WINGDIPAPI GdipGetPenCompoundCount(GpPen *pen, INT *count) | Gets the number of elements in a compound array. | |
|
GpStatus WINGDIPAPI GdipSetPenCompoundArray(GpPen *pen, GDIPCONST REAL *dash, INT count) |
Status Pen::SetCompoundArray(IN const REAL* compoundArray, IN INT count) | Sets the compound array currently set for this Pen object. |
|
GpStatus WINGDIPAPI GdipGetPenCompoundArray(GpPen *pen, REAL *dash, INT count) |
Status Pen::GetCompoundArray(OUT REAL* compoundArray, IN INT count) const | Gets the compound array currently set for this Pen object. |
Send comments about this topic to Microsoft
Build date: 3/6/2012