Page 1 of 1

Return ncolor

Posted: Mon Sep 11, 2006 11:11 am
by Silvio
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 )

Posted: Mon Sep 11, 2006 4:40 pm
by James Bott
I'm not sure what you are asking, but if you want the color of a pen just use oPen:nColor.

James

Posted: Mon Sep 11, 2006 5:45 pm
by Silvio
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

-----------------------------

Posted: Mon Sep 11, 2006 7:04 pm
by James Bott
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

Posted: Tue Sep 12, 2006 7:58 am
by Silvio
Sorryyyyyyyyyyyy,

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

Now I terminate my Tplan 32 bit class :
Image