Return ncolor

Return ncolor

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

Postby James Bott » Mon Sep 11, 2006 4:40 pm

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

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

Postby Silvio » Mon Sep 11, 2006 5: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
User avatar
Silvio
 
Posts: 3107
Joined: Fri Oct 07, 2005 6:28 pm
Location: Teramo,Italy

Postby James Bott » Mon Sep 11, 2006 7: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
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Postby Silvio » Tue Sep 12, 2006 7:58 am

Sorryyyyyyyyyyyy,

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

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

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


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 73 guests