首页 > 其他分享 >2024年5月23日第五十五篇

2024年5月23日第五十五篇

时间:2024-05-23 22:07:32浏览次数:11  
标签:第五十五 eye 23 height 2024 width y0 x0 face

今天看了一下kotlin感觉在短时间内还是难以学完,于是打算继续用java开发android,然后用tkinter绘制了一个画像玩。

 # 脸部(方形)
    canvas.create_rectangle(x0, y0, x1, y1, fill='peachpuff', outline='black')

    # 头发
    hair_height = face_height // 5
    canvas.create_rectangle(x0, y0, x1, y0 + hair_height, fill='brown', outline='black')

    # 眼睛
    eye_width = face_width // 6
    eye_height = face_height // 8
    eye_y_offset = hair_height + face_height // 4
    eye_x_spacing = face_width // 4

    canvas.create_oval(x0 + eye_x_spacing, y0 + eye_y_offset, x0 + eye_x_spacing + eye_width, y0 + eye_y_offset + eye_height, fill='white', outline='black')
    canvas.create_oval(x1 - eye_x_spacing - eye_width, y0 + eye_y_offset, x1 - eye_x_spacing, y0 + eye_y_offset + eye_height, fill='white', outline='black')
    canvas.create_oval(x0 + eye_x_spacing + eye_width // 3, y0 + eye_y_offset + eye_height // 3, x0 + eye_x_spacing + 2 * eye_width // 3, y0 + eye_y_offset + 2 * eye_height // 3, fill='black')
    canvas.create_oval(x1 - eye_x_spacing - 2 * eye_width // 3, y0 + eye_y_offset + eye_height // 3, x1 - eye_x_spacing - eye_width // 3, y0 + eye_y_offset + 2 * eye_height // 3, fill='black')

    # 鼻子
    nose_width = face_width // 10
    nose_height = face_height // 6
    nose_x = x0 + (x1 - x0) // 2
    nose_y = y0 + face_height // 2

    canvas.create_polygon(nose_x, nose_y, nose_x - nose_width // 2, nose_y + nose_height, nose_x + nose_width // 2, nose_y + nose_height, fill='peachpuff', outline='black')

    # 嘴巴
    mouth_width = face_width // 2
    mouth_height = face_height // 8
    mouth_x0 = x0 + (face_width - mouth_width) // 2
    mouth_y0 = y1 - face_height // 4
    mouth_x1 = mouth_x0 + mouth_width
    mouth_y1 = mouth_y0 + mouth_height

    canvas.create_arc(mouth_x0, mouth_y0, mouth_x1, mouth_y1, start=0, extent=-180, style=ARC, outline='red', width=2)

    # 眼镜框
    glass_width = face_width // 6
    glass_height = face_height // 8
    glass_y_offset = hair_height + face_height // 4
    glass_x_spacing = face_width // 4

    # 左眼镜框
    canvas.create_rectangle(x0 + glass_x_spacing, y0 + glass_y_offset, x0 + glass_x_spacing + glass_width, y0 + glass_y_offset + glass_height, outline='black', width=2)
    # 右眼镜框
    canvas.create_rectangle(x1 - glass_x_spacing - glass_width, y0 + glass_y_offset, x1 - glass_x_spacing, y0 + glass_y_offset + glass_height, outline='black', width=2)

    # 眼镜支架
    bridge_width = face_width // 10
    bridge_height = face_height // 30
    bridge_x1 = x0 + (x1 - x0 - bridge_width) // 2
    bridge_y1 = y0 + eye_y_offset + eye_height // 2
    bridge_x2 = x1 - (x1 - x0 - bridge_width) // 2
    bridge_y2 = bridge_y1

    canvas.create_line(bridge_x1, bridge_y1, bridge_x2, bridge_y2, fill='black', width=2)

 

标签:第五十五,eye,23,height,2024,width,y0,x0,face
From: https://www.cnblogs.com/xuechenhao173/p/18209462

相关文章

  • 整理好了!2024年最常见 20 道 Redis面试题(四)
    上一篇地址:整理好了!2024年最常见20道Redis面试题(三)-CSDN博客七、Redis单线程模型是如何工作的?Redis是一个基于单线程模型的高性能键值存储数据库。尽管Redis操作大多数是单线程执行的,但它依然能够提供极高的性能,这主要得益于以下几个方面:单线程模型:Redis的所有操......
  • THUSC & APIO 2024 游记
    Day\(-\infty\)APIO被补录了?Day\(-\infty+1\)听说要报名THUSC?Day\(-\infty+10^9\)考完期中紧张地跑到机房来看看THU结果,结果学习CCF的左右(Day\(-\infty+10^9+1\)电脑一开屏保,上面赫然一行字:打印报到证-通过差点把心脏吓出来Day\(-1\)不想上whk,我......
  • 50-53-57 20240523
     50Shesawme,andwalkedover.Sheteeteredalittle,butitwasnotduetoheronde-tubercularleg.forherlimpwasalmostgone.teeter=towalkormoveunsteadilyorunsurely;totter;wobbletubercular=relatingtoorsufferingfromtuberculosis1这段文字描述......
  • 5-23安全运维管理
    环境管理:1.应指定专门的部门或人员负责机房安全,对机房出人进行管理,定期对机房供配电、空调、温湿度控制、消防等设施进行维护管理。2.应建立机房安全管理制度,对有关物理访问、物品进出和环境安全等方面的管理作出规定3.应不在重要区域接待来访人员,不随意放置含......
  • 全球2023年自然科学指数(Nature Index),各单位排名表
    地址:https://www.nature.com/nature-index/annual-tables/2023/institution/all/all/global自然科学指数(NatureIndex)大揭秘!近日,自然指数官网更新自然指数排名数据(统计时间节点为2022.11.1-2023.10.31),中国高校表现依旧强势。统计结果显示,重庆大学进入全球排名TOP200,位列全球......
  • 5-23安全建设管理
    定级和备案:1.应以书面的形式说明保护对象的安全保护等级及确定等级的方法和理由。2.应组织相关部门和有关安全技术专家对定级结果的合理性和正确性进行论证和审定。3.应保证定级结果经过相关部门的批准4.应将备案材料报主管部门和公安机关备案安全方案设计:......
  • 5-23安全管理人员
    人员录用1.应指定或授权专门的部门或人员负责人员录用2.应对被录用人员的身份、安全背景、专业资格或资质等进行审查,对其所具有的技术技能进行考核3.应与被录用人员签署保密协议,与关键岗位人员签署岗位责任协议人员离岗:1.应及时终止离岗人员的所有访问权限......
  • 5-23安全管理机构
    岗位设置:1.应成立指导和网络安全工作的委员会或领导小组,其最高领导由单位主管领导担任或授权。2.应设立网络安全管理工作的职能部门,设立安全主管、安全管理各个方面的负责人岗位,并定义各负责人的职责。3.应设立系统管理员、审计管理员和安全管理员等岗位,并定义......
  • CCL 2024 Task7 双任务冠军
        随着教育的发展和网络的普及,作文评价的规模越来越大,人工评改作文的成本和效率成为一大难题。为了解决这一问题,许多研究者和机构开始探索利用计算机技术来实现作文的自动评改[1],通过分析作文的语言、内容、结构等方面的特点及存在的问题,给出客观、准确、及时的评分和反......
  • 世微AP5125 外置MOS管5-100V 8A平均电流型LED降压恒流驱动器 SOT23-6
    产品描述  AP5125是一款外围电路简单的Buck型平均电流检测模式的LED恒流驱动器,适用于8-100V电压范围的非隔离式大功率恒流LED驱动领域。芯片采用固定频率140kHz的PWM工作模式,利用平均电流检测模式,因此具有优异的负载调整率特性,高精度的输出电流特性。AP5125......