I want to know how does the anchor works when we insert a bitmap file in a canvas.
I try to fill the canvas with a bitmap of the same size but I don't understand how does the anchor works in the canvas and the bitmap isn't well placed!
- Example:
# Create and place canvas
canvas .cnvs -borderwidth 0 -height 96 -width 216
place .cnvs -x 125 -y 10 -anchor nw
# Insert a new bitmap
set filename "$::env(HOME)/screen.bmp"
.cnvs create bitmap X Y -bitmap @$filename -tags scr
Now if I affect 0 into X and Y, I see only a part of my bitmap, I have to set X to 109 and Y to 50 to see the entire bitmap on the canvas.
PS: I don't want to use something like:
"canvas .cnvs -bitmap @$filename..." because the content of the canvas often change.
Thanx for your answers, Anto.
I try to fill the canvas with a bitmap of the same size but I don't understand how does the anchor works in the canvas and the bitmap isn't well placed!
- Example:
# Create and place canvas
canvas .cnvs -borderwidth 0 -height 96 -width 216
place .cnvs -x 125 -y 10 -anchor nw
# Insert a new bitmap
set filename "$::env(HOME)/screen.bmp"
.cnvs create bitmap X Y -bitmap @$filename -tags scr
Now if I affect 0 into X and Y, I see only a part of my bitmap, I have to set X to 109 and Y to 50 to see the entire bitmap on the canvas.
PS: I don't want to use something like:
"canvas .cnvs -bitmap @$filename..." because the content of the canvas often change.
Thanx for your answers, Anto.