Shiny Language Reference

Language Reference > Drawing Functions


selectpen

selectpen(pen PenVar);

 

Synonyms:

penselect(pen PenVar);

 

 

Selects the specified pen for use

SELECTPEN tells Brass to use the specified pen for all future drawing operations (such as DRAWLINE) until SELECTPEN is called again. The pen must have been previously configured by using CREATEPEN.

This statement is only valid in the Render handler.

 

Parameters

PenVar

A variable declared as type PEN to use for all future drawing operations.

 

Return Value

None

 

Example Code

// Initialize MyPen as a solid, 3 pixel wide red pen
pen MyPen;
createpen(MyPen, 0, 3, RGB(255, 0, 0));

// Use MyPen for all drawing operations
selectpen(MyPen);

// drawline will now draw using MyPen - a solid, 3px red pen
drawline(10, 10, 20, 20);