Specifies the pattern used for object text and borders.
# Metadata
Platforms: desktop, server, mobile OS: mac, windows, linux, ios, android Introduced: 1.0 Security:
# Syntax
set the foregroundPattern of object to {patternNumber | imageID | empty}
# Examples
set the foregroundPattern of me to 1034
set the textPattern of line 2 of field "Cards" to 111
# Description
Use the foregroundPattern property to change the pattern used for text or the pattern that fills an object.
Pattern images can be color or black-and-white.
>*Cross-platform note:* To be used as a pattern on > Mac OS, 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, 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.
The foregroundPattern of controls is drawn starting at the control upper right corner: if the control is moved, the pattern does not shift.
Setting the foregroundPattern of an object to empty allows the foregroundPattern of the object owner to show through. Use the effective keyword to find out what pattern is used for the object, even if its own foregroundPattern is empty.
The setting of the foregroundPattern property has different effects, depending on the object type:
* The foregroundPattern of a stack, card, or group determines the foregroundPattern of each object in the stack, card, or group that does not have its own foregroundPattern.
* On Unix systems, the foregroundPattern of a button is used for the text of the button. If the button showName property is false, the foregroundPattern has no effect.
* On Unix systems, the foregroundPattern of a field determines the color of the field text. If you set the foregroundColor of a chunk of a field, only that chunk is affected. The foregroundPattern also determines the color of the blinking insertion point when it is in the field.
* On Unix systems, the foregroundPattern of a scrollbar determines the pattern of the text used to show the value of the scrollbar current position. If the scrollbar showValue property is false, the foregroundPattern has no effect.
* The foregroundPattern of a graphic determines the pattern used for the graphic outline. (The borderPattern determines the pattern used for the graphic border, which is outside the outline.)
* The foregroundPattern of a player, image, audio clip, video clip, or EPS has no effect. If an object's foregroundPattern is set, the pattern is shown instead of the color specified by foregroundColor.
>*Cross-platform note:* On Mac OS and Windows, the > foregroundPattern applies only to object borders, not to > text; text cannot be drawn with a pattern, only with a color.
# Tags
ui,
# See
- **keyword:** effective, field, image, button, card, scrollbar, player, graphic, control - **property:** borderPattern, foregroundColor, pixels, bottomPattern, width, height, backgroundPattern, dashes, showName, penPattern, owner, showValue - **command:** group - **function:** stacks - **glossary:** object, Unix, current stack, property, Windows, video clip, keyword, audio clip, chunk, insertion point, value, object type, EPS, Mac OS - **object:** control, button, scrollbar, stack, field, graphic