1 |
578 |
markom |
'\"
|
2 |
|
|
'\" Copyright (c) 1994 The Regents of the University of California.
|
3 |
|
|
'\" Copyright (c) 1994-1996 Sun Microsystems, Inc.
|
4 |
|
|
'\"
|
5 |
|
|
'\" See the file "license.terms" for information on usage and redistribution
|
6 |
|
|
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
7 |
|
|
'\"
|
8 |
|
|
'\" RCS: @(#) $Id: bitmap.n,v 1.1.1.1 2002-01-16 10:25:48 markom Exp $
|
9 |
|
|
'\"
|
10 |
|
|
.so man.macros
|
11 |
|
|
.TH bitmap n 4.0 Tk "Tk Built-In Commands"
|
12 |
|
|
.BS
|
13 |
|
|
'\" Note: do not modify the .SH NAME line immediately below!
|
14 |
|
|
.SH NAME
|
15 |
|
|
bitmap \- Images that display two colors
|
16 |
|
|
.SH SYNOPSIS
|
17 |
|
|
\fBimage create bitmap \fR?\fIname\fR? ?\fIoptions\fR?
|
18 |
|
|
.BE
|
19 |
|
|
|
20 |
|
|
.SH DESCRIPTION
|
21 |
|
|
.PP
|
22 |
|
|
A bitmap is an image whose pixels can display either of two colors
|
23 |
|
|
or be transparent.
|
24 |
|
|
A bitmap image is defined by four things: a background color,
|
25 |
|
|
a foreground color, and two bitmaps, called the \fIsource\fR
|
26 |
|
|
and the \fImask\fR.
|
27 |
|
|
Each of the bitmaps specifies 0/1 values for a rectangular
|
28 |
|
|
array of pixels, and the two bitmaps must have the same
|
29 |
|
|
dimensions.
|
30 |
|
|
For pixels where the mask is zero, the image displays nothing,
|
31 |
|
|
producing a transparent effect.
|
32 |
|
|
For other pixels, the image displays the foreground color if
|
33 |
|
|
the source data is one and the background color if the source
|
34 |
|
|
data is zero.
|
35 |
|
|
|
36 |
|
|
.SH "CREATING BITMAPS"
|
37 |
|
|
.PP
|
38 |
|
|
Like all images, bitmaps are created using the \fBimage create\fR
|
39 |
|
|
command.
|
40 |
|
|
Bitmaps support the following \fIoptions\fR:
|
41 |
|
|
.TP
|
42 |
|
|
\fB\-background \fIcolor\fR
|
43 |
|
|
Specifies a background color for the image in any of the standard
|
44 |
|
|
ways accepted by Tk. If this option is set to an empty string
|
45 |
|
|
then the background pixels will be transparent. This effect
|
46 |
|
|
is achieved by using the source bitmap as the mask bitmap, ignoring
|
47 |
|
|
any \fB\-maskdata\fR or \fB\-maskfile\fR options.
|
48 |
|
|
.TP
|
49 |
|
|
\fB\-data \fIstring\fR
|
50 |
|
|
Specifies the contents of the source bitmap as a string.
|
51 |
|
|
The string must adhere to X11 bitmap format (e.g., as generated
|
52 |
|
|
by the \fBbitmap\fR program).
|
53 |
|
|
If both the \fB\-data\fR and \fB\-file\fR options are specified,
|
54 |
|
|
the \fB\-data\fR option takes precedence.
|
55 |
|
|
.TP
|
56 |
|
|
\fB\-file \fIname\fR
|
57 |
|
|
\fIname\fR gives the name of a file whose contents define the
|
58 |
|
|
source bitmap.
|
59 |
|
|
The file must adhere to X11 bitmap format (e.g., as generated
|
60 |
|
|
by the \fBbitmap\fR program).
|
61 |
|
|
.TP
|
62 |
|
|
\fB\-foreground \fIcolor\fR
|
63 |
|
|
Specifies a foreground color for the image in any of the standard
|
64 |
|
|
ways accepted by Tk.
|
65 |
|
|
.TP
|
66 |
|
|
\fB\-maskdata \fIstring\fR
|
67 |
|
|
Specifies the contents of the mask as a string.
|
68 |
|
|
The string must adhere to X11 bitmap format (e.g., as generated
|
69 |
|
|
by the \fBbitmap\fR program).
|
70 |
|
|
If both the \fB\-maskdata\fR and \fB\-maskfile\fR options are specified,
|
71 |
|
|
the \fB\-maskdata\fR option takes precedence.
|
72 |
|
|
.TP
|
73 |
|
|
\fB\-maskfile \fIname\fR
|
74 |
|
|
\fIname\fR gives the name of a file whose contents define the
|
75 |
|
|
mask.
|
76 |
|
|
The file must adhere to X11 bitmap format (e.g., as generated
|
77 |
|
|
by the \fBbitmap\fR program).
|
78 |
|
|
|
79 |
|
|
.SH "IMAGE COMMAND"
|
80 |
|
|
.PP
|
81 |
|
|
When a bitmap image is created, Tk also creates a new command
|
82 |
|
|
whose name is the same as the image.
|
83 |
|
|
This command may be used to invoke various operations
|
84 |
|
|
on the image.
|
85 |
|
|
It has the following general form:
|
86 |
|
|
.CS
|
87 |
|
|
\fIimageName option \fR?\fIarg arg ...\fR?
|
88 |
|
|
.CE
|
89 |
|
|
\fIOption\fR and the \fIarg\fRs
|
90 |
|
|
determine the exact behavior of the command. The following
|
91 |
|
|
commands are possible for bitmap images:
|
92 |
|
|
.TP
|
93 |
|
|
\fIimageName \fBcget\fR \fIoption\fR
|
94 |
|
|
Returns the current value of the configuration option given
|
95 |
|
|
by \fIoption\fR.
|
96 |
|
|
\fIOption\fR may have any of the values accepted by the
|
97 |
|
|
\fBimage create bitmap\fR command.
|
98 |
|
|
.TP
|
99 |
|
|
\fIimageName \fBconfigure\fR ?\fIoption\fR? ?\fIvalue option value ...\fR?
|
100 |
|
|
Query or modify the configuration options for the image.
|
101 |
|
|
If no \fIoption\fR is specified, returns a list describing all of
|
102 |
|
|
the available options for \fIimageName\fR (see \fBTk_ConfigureInfo\fR for
|
103 |
|
|
information on the format of this list). If \fIoption\fR is specified
|
104 |
|
|
with no \fIvalue\fR, then the command returns a list describing the
|
105 |
|
|
one named option (this list will be identical to the corresponding
|
106 |
|
|
sublist of the value returned if no \fIoption\fR is specified). If
|
107 |
|
|
one or more \fIoption\-value\fR pairs are specified, then the command
|
108 |
|
|
modifies the given option(s) to have the given value(s); in
|
109 |
|
|
this case the command returns an empty string.
|
110 |
|
|
\fIOption\fR may have any of the values accepted by the
|
111 |
|
|
\fBimage create bitmap\fR command.
|
112 |
|
|
|
113 |
|
|
.SH KEYWORDS
|
114 |
|
|
bitmap, image
|