twindow:circle()

twindow:circle()

Postby reinaldocrespo » Fri Mar 17, 2006 2: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.
User avatar
reinaldocrespo
 
Posts: 979
Joined: Thu Nov 17, 2005 5:49 pm
Location: Fort Lauderdale, FL

Re: twindow:circle()

Postby Enrico Maria Giordano » Fri Mar 17, 2006 3:37 pm

This is a working sample:

Code: Select all  Expand view  RUN
#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
User avatar
Enrico Maria Giordano
 
Posts: 8718
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Postby reinaldocrespo » 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,...
User avatar
reinaldocrespo
 
Posts: 979
Joined: Thu Nov 17, 2005 5:49 pm
Location: Fort Lauderdale, FL

Postby Enrico Maria Giordano » Sat Mar 18, 2006 11:08 am

It is implicitly passed by the codeblock bPainted.

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8718
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 58 guests