Declare Function Rectangle Lib "gdi32.dll" (ByVal hdc As Long, ByVal X1 As Long, ByVal Y1 As Long, ByVal X2 As Long, ByVal Y2 As Long) As Long
Rectangle draws a rectangular-shaped box on a graphics-capable device. The rectangle is drawn using the color of the object's .ForeColor property. The function returns 0 if an error occured, or a non-zero value if successful.
Example:
' Draw a green rectangle on Picture1 from (25,25) to (100,50)
Picture1.ForeColor = RGB(0, 255, 0) ' green
x = Rectangle(Picture1.hdc, 25, 25, 100, 50)
Related Call: RoundRect
Category: Graphics
Back to the index.