Name: penPattern

Type: property

Syntax: set the penPattern to {<patternNumber> | <imageID> | empty}

Summary: Specifies the pattern used for painting with the <paint tool|paint tools>.

Synonyms: penPat

Introduced: 1.0

OS: mac,windows,linux,ios,android

Platforms: desktop,server,web,mobile

Example:
set the penPattern to empty

Example:
set the penPattern to 1013

Value:
The <penPattern> is a pattern specifier.
A <patternNumber> is a built-in pattern number between 1 and 164. (These patterns correspond to LiveCode's built-in patterns 136 to 300.)

An <imageID> is the ID of an <image> to use for a pattern. LiveCode looks for the specified <image> first in the <current stack>, then in other open <stacks>.

By default, the <penPattern> is empty.

Description:
Use the <penPattern> <property> to change the pattern used with the <pencil>, <line>, and <curve> <paint tool|paint tools>, and for the borders of shapes.

Pattern images can be color or black-and-white.

>*Cross-platform note:*  To be used as a pattern on <Mac OS|Mac OS systems>, an <image> must be 128x128 <pixels> or less, and both its <height> and <width> must be a power of 2. To be used on <Windows> and <Unix|Unix systems>, <height> and <width> must be divisible by 8. To be used as a fully cross-platform pattern, both an image's dimensions should be one of 8, 16, 32, 64, or 128.

If the <penColor> has been set since the last time the <penPattern> was set, the color is used instead of the pattern specified by <penPattern>. In other words, the last-set <property> takes priority.

References: width (property), height (property), pixels (property), foregroundPattern (property), penColor (property), brushPattern (property), image (keyword), line (keyword), curve (keyword), pencil (keyword), choose (command), stacks (function), property (glossary), Windows (glossary), paint tool (glossary), Mac OS (glossary), Unix (glossary), current stack (glossary)

Tags: ui
