3 Star 0 Fork 0

lzq1357 / Modifying pictures

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
BottomFrame.py 1006 Bytes
一键复制 编辑 原始数据 按行查看 历史
lzq1357 提交于 2021-02-12 15:10 . bottomFrame显示坐标
from tkinter import *
import UI
class BottomFrame(Frame):
coordLb = None
def __init__(self, canv, master=None):
Frame.__init__(self, master, relief=RAISED, borderwidth=2, bg=UI.bg, width=860, height=UI.bottomHeight)
self.canv = canv
self.initView()
self.canv.bind("<Motion>", self.showCoord)
def showCoord(self, event):
xx, yy = self.canv.getCoord()
ex, ey = self.canv.realCoord(event.x, event.y)
x = int((ex - xx) / self.canv.scale)
y = int((ey - yy) / self.canv.scale)
if self.canv.img is not None:
self.coordLb["text"] = "(%d , %d)" % (x, y)
else:
self.coordLb["text"] = ""
pass
def initView(self):
bcolor = UI.bg
fcolor = UI.fg
self.coordLb = Label(self, text="",
bg=bcolor, fg=fcolor,
width=20, height=1,
font=UI.font)
self.coordLb.place(x=10, y=1)
pass
Python
1
https://gitee.com/lzq1357/Modifying-pictures.git
git@gitee.com:lzq1357/Modifying-pictures.git
lzq1357
Modifying-pictures
Modifying pictures
master

搜索帮助