时间:2021-07-01 10:21:17 帮助过:60人阅读
什么是rectangle:
rectangle是存储一组整数,共四个,表示一个矩形的位置和大小
语法:
[SerializableAttribute] [TypeConverterAttribute(typeof(RectangleConverter))] [ComVisibleAttribute(true)] public struct Rectangle
程序源代码:
#!/usr/bin/python# -*- coding: UTF-8 -*-if __name__ == '__main__': from Tkinter import * canvas = Canvas(width = 400,height = 600,bg = 'white') left = 20 right = 50 top = 50 num = 15 for i in range(num): canvas.create_oval(250 - right,250 - left,250 + right,250 + left) canvas.create_oval(250 - 20,250 - top,250 + 20,250 + top) canvas.create_rectangle(20 - 2 * i,20 - 2 * i,10 * (i + 2),10 * ( i + 2)) right += 5 left += 5 top += 10 canvas.pack() mainloop()
以上实例输出结果为:
以上就是rectangle是什么意思,如何利用elipse和rectangle画图的详细内容,更多请关注Gxl网其它相关文章!