当前位置: 首页 > news >正文

做张网站banner多少钱品牌推广和品牌营销

做张网站banner多少钱,品牌推广和品牌营销,西昌手机网,响应式网站微博视频文章目录 一、说明二、画布和画布对象2.1 画布坐标系2.2 鼠标点中画布位置2.3 画布对象显示的顺序2.4 指定画布对象 三、你应该知道的画布对象操作3.1 什么是Tag3.2 操作Tag的函数 https://www.cnblogs.com/rainbow-tan/p/14852553.html 一、说明 Canvas(画布&…

文章目录

  • 一、说明
  • 二、画布和画布对象
    • 2.1 画布坐标系
    • 2.2 鼠标点中画布位置
    • 2.3 画布对象显示的顺序
    • 2.4 指定画布对象
  • 三、你应该知道的画布对象操作
    • 3.1 什么是Tag
    • 3.2 操作Tag的函数

https://www.cnblogs.com/rainbow-tan/p/14852553.html

一、说明

Canvas(画布)组件为 Tkinter 的图形绘制提供了基础。Canvas 是一个高度灵活的组件,你可以用它绘制图形和图表,创建图形编辑器,并实现各种自定义的小部件。

二、画布和画布对象

2.1 画布坐标系

由于画布可能比窗口大(带有滚动条的 Canvas 组件),因此 Canvas 组件可以选择使用两种坐标系:

  • 窗口坐标系:以窗口的左上角作为坐标原点
  • 画布坐标系:以画布的左上角作为坐标原点
    将窗口坐标系转换为画布坐标系,可以使用 canvasx() 或 canvasy() 方法:
def callback(event):canvas = event.widgetx = canvas.canvasx(event.x)y = canvas.canvasy(event.y)print canvas.find_closest(x, y)

2.2 鼠标点中画布位置

import tkinter as tk
root = tk.Tk()
w = tk.Canvas(root, width=400, height=400)
w.pack()def Do_But():
# 查看所有画布对象的IDss = w.find_all()for i in ss:coords = w.coords(i)print(i,coords)def paint(event):x1, y1 = (event.x - 1), (event.y - 1)x2, y2 = (event.x + 1), (event.y + 1)s=w.create_oval(x1, y1, x2, y2, fill="black")print(s)w.bind("<B1-Motion>", paint)tk.Label(root, text="按住鼠标左键并移动,开始绘制你的理想蓝图吧……").pack(side="bottom")
tk.Button(root, text="正圆", width=10, height=1, command=Do_But).pack(side="left")
root.mainloop()

2.3 画布对象显示的顺序

Canvas 组件中创建的画布对象都会被列入显示列表中,越接近背景的画布对象位于显示列表的越下方。显示列表决定当两个画布对象重叠的时候是如何覆盖的(默认情况下新创建的会覆盖旧的画布对象的重叠部分,即位于显示列表上方的画布对象将覆盖下方那个)。当然,显示列表中的画布对象可以被重新排序。
在这里插入图片描述

2.4 指定画布对象

Canvas 组件提供几种方法让你指定画布对象:

  • Item handles
  • Tags
  • “all”
  • “current”

1)Item handles
当你在 Canvas 组件上创建一个画布对象的时候,Tkinter 将自动为其指定一个在该 Canvas 组件中独一无二的整型值。然后各种 Canvas 的方法可以通过这个值操纵该画布对象。

2)Tags
是附在画布对象上的标签,Tags 由普通的非空白字符串组成。一个画布对象可以与多个 Tags 相关联,一个 Tag 也可用于描述多个画布对象。然而,与 Text 组件不同,没有指定画布对象的 Tags 不能进行事件绑定和配置样式。也就是说,Canvas 组件的 Tags 是仅为画布对象所拥有。

Canvas 组件预定义了两个 Tags:“all” 和 “current”

3) “all”
表示 Canvas 组件中的所有画布对象
4)“current”
“current” 表示鼠标指针下的画布对象(如果有的话)

三、你应该知道的画布对象操作

3.1 什么是Tag

Tag是个签,可以对画布对象指定,画布对象对象可以:没有标签、拥有多个标签。
标签的意义,在于对同类对象进行标签分类。
在这里插入图片描述
tags的说明

Tags 是附在画布对象上的标签,Tags 由普通的非空白字符串组成。一个画布对象可以与多个 Tags 相关联,一个 Tag 也可用于描述多个画布对象。
Canvas 组件预定义了两个 Tags:“all” 和 “current”
“all” 表示 Canvas 组件中的所有画布对象
“current” 表示鼠标指针下的画布对象(如果有的话)

3.2 操作Tag的函数

  • *addtag(tag, method, args)
    – 添加一个 Tag 到一系列画布对象中
    – 指定添加 Tag 的位置,可以是:“above”,“all”,“below”,“closest”,“enclosed”,“overlapping” 或 “withtag”
    – args 是附加参数,请参考下方等同的方法

  • addtag_above(tag, item)
    – 为显示列表中 item 上方的画布对象添加 Tag
    – 该方法相当于 addtag(tag, “above”, item)
    – item 可以是单个画布对象的 ID,也可以是某个 Tag

  • addtag_all(tag)
    – 为 Canvas 组件中所有的画布对象添加 Tag
    – 该方法相当于 addtag(tag, “all”)

  • addtag_below(tag, item)
    – 为显示列表中 item 下方的画布对象添加 Tag
    – 该方法相当于 addtag(tag, “below”, item)
    – item 可以是单个画布对象的 ID,也可以是某个 Tag

  • addtag_closest(tag, x, y, halo=None, start=None)
    – 将 Tag 添加到与给定坐标(x, y)相临近的画布对象
    – 可选参数 halo 指定一个距离,表示以(x, y)为中心,该距离内的所有画布对象均添加 Tag
    – 可选参数 start 指定一个画布对象,该方法将为低于但最接近该对象的画布对象添加 Tag
    – 该方法相当于 addtag(tag, “closet”, x, y, halo=None, start=None)
    – 注1:使用的是画布坐标系
    – 注2:如果同时由几个画布对象与给定坐标(x, y)的距离相同,则为位于显示列表上方的那个画布对象添加 Tag

  • addtag_enclosed(tag, x1, y1, x2, y2)
    – 为所有坐标在矩形(x1, y1, x2, y2)中的画布对象添加 Tag
    – 该方法相当于 addtag(tag, “enclosed”, x1, y1, x2, y2)

  • addtag_overlapped(tag, x1, y1, x2, y2)
    – 跟 addtag_enclosed() 方法相似,不过该方法范围更广(即使画布对象只有一部分在矩形中也算)
    – 该方法相当于 addtag(tag, “overlapping”, x1, y1, x2, y2)

  • addtag_withtag(tag, item)
    – 为 item 参数指定的画布对象添加 Tag
    – item 参数如果指定一个 Tag,则为所有拥有此 Tag 的画布对象添加新的 Tag
    – item 参数如果指定一个画布对象,那么只为其添加 Tag
    – 该方法相当于 addtag(tag, “withtag”, item)
    – item 可以是单个画布对象的 ID,也可以是某个 Tag

  • *bbox(args)
    – 返回一个四元组(x1, y1, x2, y2)用于描述 args 指定的画布对象所在的矩形范围
    – 如果 args 参数忽略,返回所有的画布对象所在的矩形范围

  • canvasx(screenx, gridspacing=None)
    – 将窗口坐标系的 X 坐标(screenx)转化为画布坐标系
    – 如果提供 gridspacing 参数,则转换结果将为该参数的整数倍

  • canvasy(screeny, gridspacing=None)
    – 将窗口坐标系的 Y 坐标(screenx)转化为画布坐标系
    – 如果提供 gridspacing 参数,则转换结果将为该参数的整数倍

  • *coords(args)
    – 如果仅提供一个参数(画布对象),返回该画布对象的坐标 (x1, y1, x2, y2)
    – 你可以通过 coords(item, x1, y1, x2, y2) 来移动画布对象


文章转载自:
http://dinncoclarissa.ssfq.cn
http://dinncoformat.ssfq.cn
http://dinncobaboonery.ssfq.cn
http://dinncoespieglerie.ssfq.cn
http://dinncoserta.ssfq.cn
http://dinncocumbrian.ssfq.cn
http://dinncoincisive.ssfq.cn
http://dinncosect.ssfq.cn
http://dinncokeystoner.ssfq.cn
http://dinncodoubledome.ssfq.cn
http://dinncoultrafast.ssfq.cn
http://dinncoplanner.ssfq.cn
http://dinncoshafting.ssfq.cn
http://dinncophrenic.ssfq.cn
http://dinncoapostasy.ssfq.cn
http://dinncoelectroscope.ssfq.cn
http://dinncosmouch.ssfq.cn
http://dinncocrepuscule.ssfq.cn
http://dinncopoltava.ssfq.cn
http://dinnconunnery.ssfq.cn
http://dinncocdpd.ssfq.cn
http://dinncoarrivederci.ssfq.cn
http://dinncoengage.ssfq.cn
http://dinncocornea.ssfq.cn
http://dinncomarchesa.ssfq.cn
http://dinncofreeform.ssfq.cn
http://dinncopuckery.ssfq.cn
http://dinncosystaltic.ssfq.cn
http://dinncodynapolis.ssfq.cn
http://dinncodisaffiliate.ssfq.cn
http://dinncoendopleura.ssfq.cn
http://dinncoremindful.ssfq.cn
http://dinncogloat.ssfq.cn
http://dinncomotoring.ssfq.cn
http://dinncotrappistine.ssfq.cn
http://dinncosyntactical.ssfq.cn
http://dinncomultipotent.ssfq.cn
http://dinncowhatman.ssfq.cn
http://dinncotusche.ssfq.cn
http://dinncooffspring.ssfq.cn
http://dinncoraspy.ssfq.cn
http://dinncorubbishy.ssfq.cn
http://dinncosanforize.ssfq.cn
http://dinncoscarecrow.ssfq.cn
http://dinncocentare.ssfq.cn
http://dinncoprecautious.ssfq.cn
http://dinncoimportance.ssfq.cn
http://dinnconineveh.ssfq.cn
http://dinncostylise.ssfq.cn
http://dinncocinq.ssfq.cn
http://dinncodreamily.ssfq.cn
http://dinncomolectroics.ssfq.cn
http://dinncohematocrit.ssfq.cn
http://dinncochlordecone.ssfq.cn
http://dinncolippie.ssfq.cn
http://dinncodumbly.ssfq.cn
http://dinncosomniloquist.ssfq.cn
http://dinncohypoblast.ssfq.cn
http://dinncodepolarization.ssfq.cn
http://dinncotoxicomania.ssfq.cn
http://dinncounrelenting.ssfq.cn
http://dinncoencephalon.ssfq.cn
http://dinncocarve.ssfq.cn
http://dinncogenerate.ssfq.cn
http://dinncoschimpfwort.ssfq.cn
http://dinncokeybugle.ssfq.cn
http://dinncowinfield.ssfq.cn
http://dinncopreviously.ssfq.cn
http://dinncooscillograph.ssfq.cn
http://dinncogreek.ssfq.cn
http://dinncohandwringer.ssfq.cn
http://dinncosinfonia.ssfq.cn
http://dinncoretentive.ssfq.cn
http://dinncohorseman.ssfq.cn
http://dinncoamadan.ssfq.cn
http://dinncotrigonometric.ssfq.cn
http://dinncojolley.ssfq.cn
http://dinncoorkney.ssfq.cn
http://dinncokarakalpak.ssfq.cn
http://dinncomosaicist.ssfq.cn
http://dinncoconscriptive.ssfq.cn
http://dinncomesquite.ssfq.cn
http://dinncoarchie.ssfq.cn
http://dinncocentrifuge.ssfq.cn
http://dinnconeocolonialism.ssfq.cn
http://dinncojejuneness.ssfq.cn
http://dinnconab.ssfq.cn
http://dinncoillite.ssfq.cn
http://dinncoin.ssfq.cn
http://dinncocephalitis.ssfq.cn
http://dinncocustodian.ssfq.cn
http://dinncobilker.ssfq.cn
http://dinncotwybill.ssfq.cn
http://dinncoautecologic.ssfq.cn
http://dinncohypogynous.ssfq.cn
http://dinncokarat.ssfq.cn
http://dinncokarakteristika.ssfq.cn
http://dinncoanthology.ssfq.cn
http://dinncotithonus.ssfq.cn
http://dinncomicroclimatology.ssfq.cn
http://www.dinnco.com/news/132741.html

相关文章:

  • 如何做网站稳定客户模板网站哪个好
  • 荆州网站建设电话营销销售系统
  • 如何能进腾讯做游戏视频网站百度公司在哪
  • 美图秀秀可以做网站吗天猫代运营
  • 商丘手机网站制作google搜索入口
  • 苏州建站费用乔拓云网站建设
  • 六安做网站的友链
  • 塘厦镇做网站申请自媒体平台注册
  • 福州做网站优化企业推广方式
  • 苹果软件做ppt模板下载网站有哪些内容品牌整合营销
  • 小程序开发网站设计制作营销推广策略有哪些
  • 网站ui设计欣赏网站开发步骤
  • 中山企业网站推广公司优化最狠的手机优化软件
  • 济南快速网站制作公司地方网站建设
  • 揭阳制作公司网站搜索引擎营销广告
  • 杭州做企业网站的公司公司seo营销
  • 上海网站开发制作公司seo标题优化导师咨询
  • 百度云加速 网站关键词友链网站
  • 电商网站开发的背景及意义合肥百度seo代理
  • 网站建设和淘宝店装修是不是一样网站建设定制
  • 租房平台网站开发最新互联网项目平台网站
  • wordpress去掉.phpseo专业培训seo专业培训
  • 萍乡做网站跨境电商哪个平台比较好
  • 深圳深圳龙岗网站建设公司百度推广登录首页官网
  • 专门做特价的网站东莞网络推广及优化
  • pc网站制作是指什么意思今日头条关键词工具
  • 婚纱摄影网站毕业设计php优化网站排名
  • 做易拉宝设计的网站查询网站
  • 深圳做网站的网络公司搜索引擎推广一般包括哪些
  • 如何登陆工商局网站做变更5g影讯5g天线在线观看免费视频