1Bitmap(3)             User Contributed Perl Documentation            Bitmap(3)
2
3
4

NAME

6       Tk::Bitmap - Images that display two colors
7

SYNOPSIS

9           $image = $widget->Bitmap?(name??,options?)
10

DESCRIPTION

12       A bitmap is an image whose pixels can display either of two colors or
13       be transparent.  A bitmap image is defined by four things:  a
14       background color, a foreground color, and two bitmaps, called the
15       source and the mask.  Each of the bitmaps specifies 0/1 values for a
16       rectangular array of pixels, and the two bitmaps must have the same
17       dimensions.  For pixels where the mask is zero, the image displays
18       nothing, producing a transparent effect.  For other pixels, the image
19       displays the foreground color if the source data is one and the
20       background color if the source data is zero.
21

CREATING BITMAPS

23       Bitmaps are created using $widget->Bitmap.  Bitmaps support the
24       following options:
25
26       -background => color
27           Specifies a background color for the image in any of the standard
28           ways accepted by Tk.  If this option is set to an empty string then
29           the background pixels will be transparent.  This effect is achieved
30           by using the source bitmap as the mask bitmap, ignoring any
31           -maskdata or -maskfile options.
32
33       -data => string
34           Specifies the contents of the source bitmap as a string.  The
35           string must adhere to X11 bitmap format (e.g., as generated by the
36           bitmap program).  If both the -data and -file options are
37           specified, the -data option takes precedence.
38
39       -file => name
40           name gives the name of a file whose contents define the source
41           bitmap.  The file must adhere to X11 bitmap format (e.g., as
42           generated by the bitmap program).
43
44       -foreground => color
45           Specifies a foreground color for the image in any of the standard
46           ways accepted by Tk.
47
48       -maskdata => string
49           Specifies the contents of the mask as a string.  The string must
50           adhere to X11 bitmap format (e.g., as generated by the bitmap
51           program).  If both the -maskdata and -maskfile options are
52           specified, the -maskdata option takes precedence.
53
54       -maskfile => name
55           name gives the name of a file whose contents define the mask.  The
56           file must adhere to X11 bitmap format (e.g., as generated by the
57           bitmap program).
58

IMAGE METHODS

60       When a bitmap image is created, Tk also creates a new object.  This
61       object supports the configure and cget methods described in Tk::options
62       which can be used to enquire and modify the options described above.
63

SEE ALSO

65       Tk::Image Tk::Pixmap Tk::Photo
66

KEYWORDS

68       bitmap, image
69
70
71
72perl v5.34.0                      2022-01-21                         Bitmap(3)
Impressum