Pen::GetCompoundArray method (gdipluspen.h)

The Pen::GetCompoundArray method gets the compound array currently set for this Pen object.

Syntax

Status GetCompoundArray(
  [out] REAL *compoundArray,
  [in]  INT  count
);

Parameters

[out] compoundArray

Type: REAL*

Pointer to an array that receives the compound array.

[in] count

Type: INT

Integer that specifies the number of elements in the compoundArray array.

Return value

Type: Status

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

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

Remarks

Suppose that a compound array contains the values 0.0, 0.2, 0.7, and 1.0 and that the pen has a width of 100. When you use the pen to draw, you get two parallel lines. The first line has a width of 20, the space between the two lines has a width of 50, and the second line has a width of 30.

For a more complex example, suppose that a compound array contains the values 0.0, 0.2, 0.3, 0.6, 0.85, and 1.0 and that the pen has a width of 100. When you use the pen to draw, you get three parallel lines. The widths of the three lines are 20, 30, and 15 respectively. The widths of the two spaces between the lines are 10 and 25 respectively.

Examples

The following example gets the compound array for a Pen object. Assuming that a compound array has been set for this Pen object, the code then gets the entries that have been set for this pen.

INT count = pen.GetCompoundCount();
REAL * distances = new REAL[count];
Status stat = pen.GetCompoundArray(distances, count);

Requirements

Requirement Value
Minimum supported client Windows XP, Windows 2000 Professional [desktop apps only]
Minimum supported server Windows 2000 Server [desktop apps only]
Target Platform Windows
Header gdipluspen.h (include Gdiplus.h)
Library Gdiplus.lib
DLL Gdiplus.dll

See also

Pen

Pen::SetCompoundArray

Pens, Lines, and Rectangles