Example: |
image create bitmap ::img::bike -data "#define bike_width 29
#define bike_height 17
static unsigned char bike_bits[] = {
0x80, 0x03, 0x3f, 0x00, 0x60, 0x02, 0x3e, 0x00, 0x10, 0x02, 0x08, 0x00,
0x10, 0xfe, 0x0f, 0x00, 0x60, 0x02, 0x0c, 0x00, 0x00, 0x07, 0x0e, 0x00,
0xf8, 0x09, 0xfa, 0x03, 0x86, 0x09, 0x39, 0x0c, 0x82, 0x12, 0x39, 0x08,
0xc1, 0xb2, 0x24, 0x10, 0x41, 0xa4, 0xc4, 0x10, 0x21, 0xc4, 0xe4, 0x11,
0x01, 0x44, 0x1f, 0x10, 0x01, 0x44, 0x04, 0x10, 0x02, 0x62, 0x08, 0x08,
0x06, 0x03, 0x18, 0x0c, 0xf8, 0x00, 0xe0, 0x03 };"
label .lvelo -image ::img::bike
button .bvelo -image ::img::bike -command {put www.xed.ch}
radiobutton .rvelo -image ::img::bike
checkbutton .cvelo -image ::img::bike
pack .lvelo .bvelo .rvelo .cvelo -side left
|
Example: |
# Here's how to bake your own bitmaps from scratch. This is a 19x5
# bitmap, but we need 3 bytes per row (24x5) because rows must be in
# byte multiples. The bit values for each pixel are summed to produce
# a hex digit. The pairs of hex digits are swapped to form the byte.
# 1248 1248 1248 1248 1248 1248 <-bit value ;
# .... XX.. .... ..XX XXX. .... --> 0 3 0 C 7 0 --> 30 C0 70 ;
# ..XX ..X. .... .X.. .XX. .... --> C 4 0 2 6 0 --> 4C 20 60 ;
# XX.. ...X XXXX XXXX X... .... --> 3 8 F F 1 0 --> 83 FF 01 ;
# ..XX ..X. .... .X.. .XX. .... --> C 4 0 2 6 0 --> 4C 20 60 ;
# .... XX.. .... ..XX XXX. .... --> 0 3 0 C 7 0 --> 30 C0 70 ;
image create bitmap ::img::tarr -data "#define foo_width 19
#define foo_height 5
static unsigned char foo_bits[] = {
0x30, 0xC0, 0x07,
0x4C, 0x20, 0x06,
0x83, 0xFF, 0x01,
0x4C, 0x20, 0x06,
0x30, 0xC0, 0x07 };"
label .ta -image ::img::tarr -bg coral -width 50 -height 20; pack .ta
|