twindow:circle()

Post Reply
User avatar
reinaldocrespo
Posts: 918
Joined: Thu Nov 17, 2005 5:49 pm
Location: Fort Lauderdale, FL

twindow:circle()

Post by reinaldocrespo »

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
Enrico Maria Giordano
Posts: 7355
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia
Contact:

Re: twindow:circle()

Post by Enrico Maria Giordano »

This is a working sample:

Code: Select all

#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
reinaldocrespo
Posts: 918
Joined: Thu Nov 17, 2005 5:49 pm
Location: Fort Lauderdale, FL

Post by reinaldocrespo »

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,...
Post Reply