FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour NOt the same color when I load this function
Posts: 3107
Joined: Fri Oct 07, 2005 06:28 PM
NOt the same color when I load this function
Posted: 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

 DEFINE BRUSH oPenL COLOR CLR_HBLUE  
   DEFINE BRUSH oPenR COLOR CLR_HRED


and then
  disegna( nLinea+nVertic+4, nColumnaInicio+nHoriz2, nLinea+nVertic+14, nColumnaFinal+nHoriz2, oPenR )



the func disegna is this
 
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
Best Regards, Saludos



Falconi Silvio
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: NOt the same color when I load this function
Posted: 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

Posts: 3107
Joined: Fri Oct 07, 2005 06:28 PM
NOt the same color when I load this function
Posted: Mon Feb 06, 2006 08: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.

Best Regards, Saludos



Falconi Silvio

Continue the discussion