FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Return ncolor
Posts: 3107
Joined: Fri Oct 07, 2005 06:28 PM

Return ncolor

Posted: Mon Sep 11, 2006 11:11 AM

If I have define a Pen :

DEFINE PEN oPen[4] WIDTH 2 COLOR RGB(0,255,255) STYLE 0
DEFINE PEN oPen[5] WIDTH 2 COLOR RGB(255,157,255) STYLE 0

Can I to have the variable color to create a brush ?

nColor := ?????
hBru := CreateSolidBrush( nColor )
hOld := SelectObject( ::hDC, hBru )
FillRect( ::hDC, { nTop, nLeft, nBottom+nx, nRight+nx }, hBru )
SelectObject( ::hDC, hOld )
DeleteObject( hBru )

Best Regards, Saludos



Falconi Silvio
Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM

Return ncolor

Posted: Mon Sep 11, 2006 04:40 PM

I'm not sure what you are asking, but if you want the color of a pen just use oPen:nColor.

James

FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
Posts: 3107
Joined: Fri Oct 07, 2005 06:28 PM

Return ncolor

Posted: Mon Sep 11, 2006 05:45 PM

I try with

open:ncolor

and

open:nrgbcolor

NOt Run!!!

I must make it because i create before a rectangule and then i must refill it


Best Regards, Saludos



Falconi Silvio
Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM

Return ncolor

Posted: Mon Sep 11, 2006 07:04 PM

Silvio,

If you are just trying to figure the color number, then:

nColor := rgb(nRed,nBlue,nGreen)
hBru := CreateSolidBrush( nColor )

RGB is just a #translate function in colors.ch.

James

FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
Posts: 3107
Joined: Fri Oct 07, 2005 06:28 PM

Return ncolor

Posted: Tue Sep 12, 2006 07:58 AM
Sorryyyyyyyyyyyy,

Now Run OK !!!!!!!!!!!

Now I terminate my Tplan 32 bit class :
Best Regards, Saludos



Falconi Silvio

Continue the discussion