FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour twindow:circle()
Posts: 990
Joined: Thu Nov 17, 2005 05:49 PM
twindow:circle()
Posted: Fri Mar 17, 2006 02:33 PM

Hi (again...)

Using the circle method of twindow I'm able to draw a circle around an bitmap ok. But, I'd like to make that circle transparent ...ie not erase the image inside de circle. Can it be done?

And, can I use a different pen to draw the circle?

Thank you,

Reinaldo.

Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: twindow:circle()
Posted: Fri Mar 17, 2006 03:37 PM
This is a working sample:

#include "Fivewin.ch"


#define BRUSH_NULL 5


FUNCTION MAIN()

    LOCAL oWnd

    DEFINE WINDOW oWnd

    ACTIVATE WINDOW oWnd;
             ON PAINT ( oWnd:Say( 3, 0, "This is a test", CLR_GREEN ),;
                        DRAWCIRCLE( oWnd, hDC, 10, 10, 100, CLR_HRED ) )

    RETURN NIL


STATIC FUNCTION DRAWCIRCLE( oWnd, hDC, nTop, nLeft, nWidth, nColor )

    LOCAL hPen := CREATEPEN( PS_SOLID, 1, nColor )

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

    oWnd:Circle( nTop, nLeft, nWidth )

    SELECTOBJECT( hDC, hOldPen )
    SELECTOBJECT( hDC, hOldBrush )

    DELETEOBJECT( hPen )

    RETURN NIL


EMG
Posts: 990
Joined: Thu Nov 17, 2005 05:49 PM
twindow:circle()
Posted: Sat Mar 18, 2006 12:09 AM
Enrico;

It works. Fantastic!

If you don't mind, let me ask you; I notice that you are making a reference to hDc, --never declared anywhere?

DRAWCIRCLE( oWnd, hDC,...
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
twindow:circle()
Posted: Sat Mar 18, 2006 11:08 AM

It is implicitly passed by the codeblock bPainted.

EMG

Continue the discussion