Declare Function RoundRect Lib "gdi32.dll" (ByVal hdc As Long, X1 As Long, Y1 As Long, X2 As Long, Y2 As Long, X3 As Long, Y3 As Long) As Long
Platforms: Win 32s, Win 95/98, Win NT
RoundRect draws a rectangle with rounded corners on a graphics-capable device. The rounded rectangle is drawn in the device's current drawing color and is filled using its current filling color and brush, if any. The first two (x,y) coordinate pairs specified are the upper-left and lower-right corners of a comparable square-cornered rectangle. The third pair specifies the width and height of the rounded corner to use. The function returns 0 if an error occured, or 1 if successful.
Example:
' Draw a green rounded rectangle on window Form1 with an upper-left
' corner of (25,30), a lower-right corner of (100,50), and rounded corners
' 10 pixels wide and 5 high
Dim retval As Long ' return value
Form1.ForeColor = RGB(0, 255, 0) ' set the foreground-drawing color to green
retval = RoundRect(Form1.hdc, 25, 30, 100, 50, 10, 5) ' draw the rectangle
Related Call: Rectangle
Category: Filled Shapes
Back to the index.