+-
python-Tkinter:在画布的底部设置0、0坐标
通常创建画布时,(0,0)坐标位于其左上角.现在,我要将其设置在左下角.我想我必须设置“ scrollbarregion”,但我不知道该怎么做.
有人可以解释吗?
最佳答案
tkinter画布不支持更改坐标系.您可以滚动画布,以使0,0出现在左下角,但这不会影响坐标系.点(1,1)将始终位于点(0,0)的右侧和下方.

从official tcl/tk documentation on the canvas开始(tkinter只是tcl / tk解释器的包装器):

COORDINATES

All coordinates related to canvases are stored as floating-point numbers. Coordinates and distances are specified in screen units, which are floating-point numbers optionally followed by one of several letters. If no letter is supplied then the distance is in pixels. If the letter is m then the distance is in millimeters on the screen; if it is c then the distance is in centimeters; i means inches, and p means printers points (1/72 inch). Larger y-coordinates refer to points lower on the screen; larger x-coordinates refer to points farther to the right. Coordinates can be specified either as an even number of parameters, or as a single list parameter containing an even number of x and y coordinate values.

TRANSFORMATIONS

Normally the origin of the canvas coordinate system is at the upper-left corner of the window containing the canvas. It is possible to adjust the origin of the canvas coordinate system relative to the origin of the window using the xview and yview widget commands; this is typically used for scrolling. Canvases do not support scaling or rotation of the canvas coordinate system relative to the window coordinate system.

点击查看更多相关文章

转载注明原文:python-Tkinter:在画布的底部设置0、0坐标 - 乐贴网