Home  >  Article  >  Backend Development  >  What does rectangle mean? How to use elipse and rectangle to draw pictures

What does rectangle mean? How to use elipse and rectangle to draw pictures

Tomorin
TomorinOriginal
2018-08-17 14:46:065616browse

In this chapter we will introducedrawing with ellipse and rectangle, and introduce in examplesWhat rectangle means: Rectangle is a function, use this function to draw a rectangle, you can use the current brush to draw Rectangular outline, filled with the current brush.

What is rectangle:

Rectangle stores a set of four integers, representing the position and size of a rectangle

Syntax :

[SerializableAttribute]
[TypeConverterAttribute(typeof(RectangleConverter))]
[ComVisibleAttribute(true)]
public struct Rectangle

Program source code:

#!/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()

The output result of the above example is:

What does rectangle mean? How to use elipse and rectangle to draw pictures


The above is the detailed content of What does rectangle mean? How to use elipse and rectangle to draw pictures. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn