123 lines
5.7 KiB
HTML
123 lines
5.7 KiB
HTML
|
<HTML><HEAD><TITLE>Tk Built-In Commands - bitmap manual page</TITLE></HEAD><BODY>
|
||
|
<DL>
|
||
|
<DD><A HREF="bitmap.htm#M2" NAME="L100">NAME</A>
|
||
|
<DL><DD>bitmap - Images that display two colors</DL>
|
||
|
<DD><A HREF="bitmap.htm#M3" NAME="L101">SYNOPSIS</A>
|
||
|
<DL>
|
||
|
<DD><B>image create bitmap </B>?<I>name</I>? ?<I>options</I>?
|
||
|
</DL>
|
||
|
<DD><A HREF="bitmap.htm#M4" NAME="L102">DESCRIPTION</A>
|
||
|
<DD><A HREF="bitmap.htm#M5" NAME="L103">CREATING BITMAPS</A>
|
||
|
<DL>
|
||
|
<DD><A HREF="bitmap.htm#M6" NAME="L104"><B>-background </B><I>color</I></A>
|
||
|
<DD><A HREF="bitmap.htm#M7" NAME="L105"><B>-data </B><I>string</I></A>
|
||
|
<DD><A HREF="bitmap.htm#M8" NAME="L106"><B>-file </B><I>name</I></A>
|
||
|
<DD><A HREF="bitmap.htm#M9" NAME="L107"><B>-foreground </B><I>color</I></A>
|
||
|
<DD><A HREF="bitmap.htm#M10" NAME="L108"><B>-maskdata </B><I>string</I></A>
|
||
|
<DD><A HREF="bitmap.htm#M11" NAME="L109"><B>-maskfile </B><I>name</I></A>
|
||
|
</DL>
|
||
|
<DD><A HREF="bitmap.htm#M12" NAME="L110">IMAGE COMMAND</A>
|
||
|
<DL>
|
||
|
<DD><A HREF="bitmap.htm#M13" NAME="L111"><I>imageName </I><B>cget</B> <I>option</I></A>
|
||
|
<DD><A HREF="bitmap.htm#M14" NAME="L112"><I>imageName </I><B>configure</B> ?<I>option</I>? ?<I>value option value ...</I>?</A>
|
||
|
</DL>
|
||
|
<DD><A HREF="bitmap.htm#M15" NAME="L113">KEYWORDS</A>
|
||
|
</DL><HR>
|
||
|
<H3><A NAME="M2">NAME</A></H3>
|
||
|
bitmap - Images that display two colors
|
||
|
<H3><A NAME="M3">SYNOPSIS</A></H3>
|
||
|
<B>image create bitmap </B>?<I>name</I>? ?<I>options</I>?<BR>
|
||
|
<H3><A NAME="M4">DESCRIPTION</A></H3>
|
||
|
A bitmap is an image whose pixels can display either of two colors
|
||
|
or be transparent.
|
||
|
A bitmap image is defined by four things: a background color,
|
||
|
a foreground color, and two bitmaps, called the <I>source</I>
|
||
|
and the <I>mask</I>.
|
||
|
Each of the bitmaps specifies 0/1 values for a rectangular
|
||
|
array of pixels, and the two bitmaps must have the same
|
||
|
dimensions.
|
||
|
For pixels where the mask is zero, the image displays nothing,
|
||
|
producing a transparent effect.
|
||
|
For other pixels, the image displays the foreground color if
|
||
|
the source data is one and the background color if the source
|
||
|
data is zero.
|
||
|
|
||
|
<H3><A NAME="M5">CREATING BITMAPS</A></H3>
|
||
|
Like all images, bitmaps are created using the <B><A HREF="../TclCmd/image.htm">image create</A></B>
|
||
|
command.
|
||
|
Bitmaps support the following <I>options</I>:
|
||
|
<P>
|
||
|
<DL>
|
||
|
<P><DT><A NAME="M6"><B>-background </B><I>color</I></A><DD>
|
||
|
Specifies a background color for the image in any of the standard
|
||
|
ways accepted by Tk. If this option is set to an empty string
|
||
|
then the background pixels will be transparent. This effect
|
||
|
is achieved by using the source bitmap as the mask bitmap, ignoring
|
||
|
any <B>-maskdata</B> or <B>-maskfile</B> options.
|
||
|
<P><DT><A NAME="M7"><B>-data </B><I>string</I></A><DD>
|
||
|
Specifies the contents of the source bitmap as a string.
|
||
|
The string must adhere to X11 bitmap format (e.g., as generated
|
||
|
by the <B>bitmap</B> program).
|
||
|
If both the <B>-data</B> and <B>-file</B> options are specified,
|
||
|
the <B>-data</B> option takes precedence.
|
||
|
<P><DT><A NAME="M8"><B>-file </B><I>name</I></A><DD>
|
||
|
<I>name</I> gives the name of a file whose contents define the
|
||
|
source bitmap.
|
||
|
The file must adhere to X11 bitmap format (e.g., as generated
|
||
|
by the <B>bitmap</B> program).
|
||
|
<P><DT><A NAME="M9"><B>-foreground </B><I>color</I></A><DD>
|
||
|
Specifies a foreground color for the image in any of the standard
|
||
|
ways accepted by Tk.
|
||
|
<P><DT><A NAME="M10"><B>-maskdata </B><I>string</I></A><DD>
|
||
|
Specifies the contents of the mask as a string.
|
||
|
The string must adhere to X11 bitmap format (e.g., as generated
|
||
|
by the <B>bitmap</B> program).
|
||
|
If both the <B>-maskdata</B> and <B>-maskfile</B> options are specified,
|
||
|
the <B>-maskdata</B> option takes precedence.
|
||
|
<P><DT><A NAME="M11"><B>-maskfile </B><I>name</I></A><DD>
|
||
|
<I>name</I> gives the name of a file whose contents define the
|
||
|
mask.
|
||
|
The file must adhere to X11 bitmap format (e.g., as generated
|
||
|
by the <B>bitmap</B> program).
|
||
|
|
||
|
<P></DL>
|
||
|
<H3><A NAME="M12">IMAGE COMMAND</A></H3>
|
||
|
When a bitmap image is created, Tk also creates a new command
|
||
|
whose name is the same as the image.
|
||
|
This command may be used to invoke various operations
|
||
|
on the image.
|
||
|
It has the following general form:
|
||
|
<PRE><I>imageName option </I>?<I>arg arg ...</I>?</PRE>
|
||
|
<I>Option</I> and the <I>arg</I>s
|
||
|
determine the exact behavior of the command. The following
|
||
|
commands are possible for bitmap images:
|
||
|
<P>
|
||
|
<DL>
|
||
|
<P><DT><A NAME="M13"><I>imageName </I><B>cget</B> <I>option</I></A><DD>
|
||
|
Returns the current value of the configuration option given
|
||
|
by <I>option</I>.
|
||
|
<I>Option</I> may have any of the values accepted by the
|
||
|
<B>image create bitmap</B> command.
|
||
|
<P><DT><A NAME="M14"><I>imageName </I><B>configure</B> ?<I>option</I>? ?<I>value option value ...</I>?</A><DD>
|
||
|
Query or modify the configuration options for the image.
|
||
|
If no <I>option</I> is specified, returns a list describing all of
|
||
|
the available options for <I>imageName</I> (see <B><A HREF="../TclLib/ConfigWidg.htm">Tk_ConfigureInfo</A></B> for
|
||
|
information on the format of this list). If <I>option</I> is specified
|
||
|
with no <I>value</I>, then the command returns a list describing the
|
||
|
one named option (this list will be identical to the corresponding
|
||
|
sublist of the value returned if no <I>option</I> is specified). If
|
||
|
one or more <I>option-value</I> pairs are specified, then the command
|
||
|
modifies the given option(s) to have the given value(s); in
|
||
|
this case the command returns an empty string.
|
||
|
<I>Option</I> may have any of the values accepted by the
|
||
|
<B>image create bitmap</B> command.
|
||
|
|
||
|
<P></DL>
|
||
|
<H3><A NAME="M15">KEYWORDS</A></H3>
|
||
|
<A href="../Keywords/B.htm#bitmap">bitmap</A>, <A href="../Keywords/I.htm#image">image</A>
|
||
|
<HR><PRE>
|
||
|
<A HREF="../copyright.htm">Copyright</A> © 1994 The Regents of the University of California.
|
||
|
<A HREF="../copyright.htm">Copyright</A> © 1994-1996 Sun Microsystems, Inc.
|
||
|
<A HREF="../copyright.htm">Copyright</A> © 1995-1997 Roger E. Critchlow Jr.</PRE>
|
||
|
</BODY></HTML>
|