Return ncolor

Post Reply
User avatar
Silvio
Posts: 3107
Joined: Fri Oct 07, 2005 6:28 pm
Location: Teramo,Italy

Return ncolor

Post 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 )
Best Regards, Saludos

Falconi Silvio
User avatar
James Bott
Posts: 4654
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA
Contact:

Post 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
User avatar
Silvio
Posts: 3107
Joined: Fri Oct 07, 2005 6:28 pm
Location: Teramo,Italy

Post 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

-----------------------------
Best Regards, Saludos

Falconi Silvio
User avatar
James Bott
Posts: 4654
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA
Contact:

Post 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
User avatar
Silvio
Posts: 3107
Joined: Fri Oct 07, 2005 6:28 pm
Location: Teramo,Italy

Post by Silvio »

Sorryyyyyyyyyyyy,

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

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

Falconi Silvio
Post Reply