- Tcl Tutorial
- Tcl - Home
- Tcl - Overview
- Tcl - Environment Setup
- Tcl - Special Variables
- Tcl - Basic Syntax
- Tcl - Commands
- Tcl - Data Types
- Tcl - Variables
- Tcl - Operators
- Tcl - Decisions
- Tcl - Loops
- Tcl - Arrays
- Tcl - Strings
- Tcl - Lists
- Tcl - Dictionary
- Tcl - Procedures
- Tcl - Packages
- Tcl - Namespaces
- Tcl - File I/O
- Tcl - Error Handling
- Tcl - Built-in Functions
- Tcl - Regular Expressions
- Tk Tutorial
- Tk - Overview
- Tk - Environment
- Tk - Special Variables
- Tk - Widgets Overview
- Tk - Basic Widgets
- Tk - Layout Widgets
- Tk - Selection Widgets
- Tk - Canvas Widgets
- Tk - Mega Widgets
- Tk - Fonts
- Tk - Images
- Tk - Events
- Tk - Windows Manager
- Tk - Geometry Manager
- Tcl/Tk Useful Resources
- Tcl/Tk - Quick Guide
- Tcl/Tk - Useful Resources
- Tcl/Tk - Discussion
Tk - Canvas Bitmap Widget
Bitmap widget is used to add bitmap to canvas. The syntax for bitmap widget is shown below −
canvasName create bitmap x y options
x and y set the location of bitmap −
Options
The options available for the bitmap widget are listed below in the following table −
Sr.No. | Syntax & Description |
---|---|
1 | -anchor position The bitmap will be positioned relative to the x and y locations. Center is default an other options are n, s, e, w, ne, se, sw, and nw. |
2 | -bitmap name Defines the bitmap to display. The available bitmaps in Tk include warning, question, questhead, info, hourglass, error, gray12, gray25, gray50, and gray75. |
A simple example for bitmap widget is shown below −
#!/usr/bin/wish canvas .myCanvas -background red -width 100 -height 100 pack .myCanvas .myCanvas create bitmap 50 50 -bitmap info
When we run the above program, we will get the following output −
tk_canvas_widgets.htm
Advertisements