BCX_CIRCLE function

Purpose: BCX_CIRCLE draws a circle.


 Syntax:

 RetVal% = BCX_CIRCLE(hWnd, _
                       RPX%, _
                       RPY%, _
                    Radius%  _
                    [, Pen]  _
                    [,Fill]  _
                [, DrawHDC])

 Parameters:

  • RetVal% Nonzero integer if the function succeeds, zero if the function fails.
  • hWnd Identifies the window where drawing takes place.
  • RPX% X-coordinate of the center of the circle.
  • RPY% Y-coordinate of the center of the circle.
  • Radius% Radius of the circle.
  • Pen [OPTIONAL] integer representing the RGB color code. The default is 0 which is a black pen.
  • Fill [OPTIONAL] integer 0 or 1. The default is zero which will not fill the CIRCLE. A value of 1 will fill the CIRCLE with the color defined in the Pen parameter.
  • DrawHDC [OPTIONAL] HDC(Handle to Device Context) pointing to an already open HDC. This is useful if a device context is to be written to many times. In this case the programmer is responsible for closing the HDC at the appropriate time.

Example:


 GUI "BCX_CIRCLE"
  
 SUB FORMLOAD
   GLOBAL Form1 AS HWND
   Form1 = BCX_FORM("BCX_CIRCLE", 0, 0, 110, 110)
   BCX_SET_FORM_COLOR(Form1,QBCOLOR(1))
   CENTER(Form1)
   SHOW(Form1)
 END SUB
  
  
 BEGIN EVENTS
   SELECT CASE CBMSG
   CASE WM_PAINT
     CALL DrawStuff
   END SELECT
 END EVENTS
  
  
 SUB DrawStuff
   BCX_CIRCLE(Form1,110,105,95,QBCOLOR(14),1)
   BCX_ARC(Form1,50,50,170,160,60,110,160,110,QBCOLOR(9))
   BCX_ARC(Form1,65,60,95,100,20,20,20,20,QBCOLOR(9))
   BCX_ARC(Form1,125,60,155,100,20,20,20,20,QBCOLOR(9))
 END SUB