FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour circles on xharbour( fw)
Posts: 3107
Joined: Fri Oct 07, 2005 06:28 PM
circles on xharbour( fw)
Posted: Mon Mar 27, 2006 12:04 PM

How create tree concentric circles ?

Regards

Best Regards, Saludos



Falconi Silvio
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
circles on xharbour( fw)
Posted: Mon Mar 27, 2006 12:20 PM
Silvio,

BOOL Ellipse(
    HDC hdc,	// handle to device context 
    int nLeftRect,	// x-coord. of bounding rectangle's upper-left corner 
    int nTopRect,	// y-coord. of bounding rectangle's upper-left corner  
    int nRightRect,	// x-coord. of bounding rectangle's lower-right corner  
    int nBottomRect 	// y-coord. bounding rectangle's f lower-right corner  
   );
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 3107
Joined: Fri Oct 07, 2005 06:28 PM
circles on xharbour( fw)
Posted: Mon Mar 27, 2006 12:24 PM
if I have
 Rectangle( ::hDC, nX, nY, nX + ::nHeight, ( nY += ::nPinWidth ) )


with ellipse
 ellipse( ::hDC, nX, nY, nX + ::nHeight, ( nY += ::nPinWidth ) )


I try it but it not draw circle concentric
Best Regards, Saludos



Falconi Silvio
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: circles on xharbour( fw)
Posted: Mon Mar 27, 2006 12:50 PM
This is a working sample:

#include "Fivewin.ch"


FUNCTION MAIN()

    LOCAL oDlg

    LOCAL nX := 100
    LOCAL nY := 100

    LOCAL nMinRad := 20
    LOCAL nMaxRad := 100

    LOCAL nStep := 10

    DEFINE DIALOG oDlg;
           SIZE 200, 200

    ACTIVATE DIALOG oDlg;
             ON PAINT CIRCLES( oDlg, hDC, nX, nY, nMinRad, nMaxRad, nStep );
             CENTER

    RETURN NIL


#define BRUSH_NULL 5


STATIC FUNCTION CIRCLES( oDlg, hDC, nX, nY, nMinRad, nMaxRad, nStep )

    LOCAL hOldBrush := SELECTOBJECT( hDC, GETSTOCKOBJECT( BRUSH_NULL ) )

    LOCAL i

    FOR i = nMinRad TO nMaxRad STEP nStep
        oDlg:Circle( nX - i, nY - i, i * 2 )
    NEXT

    SELECTOBJECT( hDC, hOldBrush )

    RETURN NIL


EMG

Continue the discussion