NOt the same color when I load this function

NOt the same color when I load this function

Postby Silvio » Sun Feb 05, 2006 10:46 am

When I load this function I insert a color as the defines :

On Main program I insert these lines

Code: Select all  Expand view
DEFINE BRUSH oPenL COLOR CLR_HBLUE 
   DEFINE BRUSH oPenR COLOR CLR_HRED


and then
Code: Select all  Expand view
  disegna( nLinea+nVertic+4, nColumnaInicio+nHoriz2, nLinea+nVertic+14, nColumnaFinal+nHoriz2, oPenR )
   



the func disegna is this
Code: Select all  Expand view

Func disegna ( nTop, nLeft, nBottom, nRight, nColor )
   LOCAL oBrush, hBru, hOld

   hBru := CreateSolidBrush( nColor )
   hPen := CreatePen( nColor )
   hOld := SelectObject( hDC, hBru )
    Rectangle( hDC, nTop, nLeft, nBottom, nRight, hPen )
  * MoveTo( hDC, nLeft, nTop )
  * LineTo( hDC, nRight, nBottom, hPen )


  FillRect( hDC, { nTop + 2, nLeft + 2, nBottom, nRight }, hBru )

   SelectObject( hDC, hOld )
   DeleteObject( hBru )

   RETURN (Nil)




but the procedure draw black rectangules ...why ?

I want blu or red rectang


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

Re: NOt the same color when I load this function

Postby Enrico Maria Giordano » Sun Feb 05, 2006 11:31 am

You haven't defined hDC (or you have not reported here the relevant code). Please post a reduced and self-contained sample of the problem.

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8715
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Postby Silvio » Mon Feb 06, 2006 8:16 am

Sorry I try to explain my problem
I definited hdc .
I insert here a func but it is a part of my class...
i cannot post here the class now
but when i erase fillrect line and define Pen instead define Brush it make a rect empty : a rectangule with border but empty i want refill this rect with he same color i selected.
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: Google [Bot] and 64 guests