dlg_draw_rect()

Draws a rectangle on an image component within a dialog.

Syntax

planetcnc.dlg_draw_rect(component, x1, y1, x2, y2, thickness, border=True, fill=False)

Parameters

Parameter Type Description Comment
component capsule Capsule object representing the component.
x1 float X-coordinate of the top-left corner.
y1 float Y-coordinate of the top-left corner.
x2 float X-coordinate of the bottom-right corner.
y2 float Y-coordinate of the bottom-right corner.
thickness float Thickness of the rectangle's border.
border bool `True` to draw the border, `False` to omit it. optional
fill bool `True` to fill the rectangle, `False` for no fill. optional

Return Value

Examples

#! /usr/bin/env python
 
import planetcnc
 
# Draw a rectangle on an image component
planetcnc.dlg_draw_rect(my_component, 10, 10, 100, 50, 2, True, False)
 
print("Rectangle drawn on image.")

See also

dlg_draw_line
dlg_draw_arrow
dlg_draw_circle
dlg_draw_rect