Site icon Python GUI

Python Windows App: Draw A Rectangle With DelphiVCL.Shape

focused black businesswoman using laptop

Photo by Ono Kosuki on Pexels.com

DelphiVCL.Shape represents a geometric shape that can be drawn on a form.

Add a Shape object to a form to draw a simple geometric shape on the form. TShape introduces properties to describe the pen used to outline the shape and the brush used to fill it.

If the shape is only part of the image of custom control, use the methods of the control’s canvas instead.
Browse all the properties, methods, and built-in properties of the DelphiVCL.Shape using dir() command:

[crayon-660565f24aced161496974/]

See the responses in our Windows command prompt:

Here is the working example of the implementation of DelphiVCL.Shape to draw a rectangle:

[crayon-660565f24acf4904215828/]

To see the result, let’s run the complete script:

[crayon-660565f24acf7735711908/]

The result:

 

Check out DelphiVCL which easily allows you to build GUIs for Windows using Python.

Watch this comprehensive introduction to Python GUI Development with DelphiVCL library video by Jim McKeeth:

Exit mobile version