circles on xharbour( fw)

Post Reply
User avatar
Silvio
Posts: 3107
Joined: Fri Oct 07, 2005 6:28 pm
Location: Teramo,Italy

circles on xharbour( fw)

Post by Silvio »

How create tree concentric circles ?

Regards
Best Regards, Saludos

Falconi Silvio
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Post by Antonio Linares »

Silvio,

Code: Select all

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
User avatar
Silvio
Posts: 3107
Joined: Fri Oct 07, 2005 6:28 pm
Location: Teramo,Italy

Post by Silvio »

if I have

Code: Select all

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

Code: Select all

 ellipse( ::hDC, nX, nY, nX + ::nHeight, ( nY += ::nPinWidth ) )
I try it but it not draw circle concentric
Best Regards, Saludos

Falconi Silvio
User avatar
Enrico Maria Giordano
Posts: 7355
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia
Contact:

Re: circles on xharbour( fw)

Post by Enrico Maria Giordano »

This is a working sample:

Code: Select all

#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
Post Reply