Haiku API Bindings
pattern
Not logged in

Documentation | InterfaceKit | pattern

DESCRIPTION

Exposes the C++ pattern struct as an 8x8 two-dimensional native list.

Patterns are used to fill shapes and backgrounds, to stroke lines, and to draw text. Each element represents a pixel; the value 1 represents the high color, and the value 0 represents the low color.

Rows run from top to bottom, and colums from left to right.

Perl

my $top_left     = $pattern->[0][0];
my $top_right    = $pattern->[0][7];
my $bottom_left  = $pattern->[7][0];
my $bottom_right = $pattern->[7][7];

Python

top_left     = pattern[0][0]
top_right    = pattern[0][7]
bottom_left  = pattern[7][0]
bottom_right = pattern[7][7]