FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour SHAPE & TRANSPARENT Clause using TsButton
Posts: 158
Joined: Tue Oct 11, 2005 03:10 PM

Aqui va

Posted: Thu Nov 30, 2006 09:33 PM
Así explica ud que se hiciera la correcion en el
METHOD PAINT() //de TBtnBmp

  // REGF DESDE AQUI 29112006
   if ::lTransparent       
      hBmpOld = SelectObject( ::hDC, ::hBitmap1 ) 
      nZeroZeroClr = GetPixel( ::hDC, 0, 0 ) 
      SelectObject( ::hDC, hBmpOld ) 
      nOldClr = SetBkColor( ::hDC, nRGB( 255, 255, 255 ) ) 
      TransBmp( ::hBitmap1, nBmpWidth( ::hBitmap1 ), nBmpHeight( ::hBitmap1 ), nZeroZeroClr, ::hDC,; 
                If( ::lPressed, 2, 1 ), If( ::lPressed, 2, 1 ),;                 
                nBmpWidth( ::hBitmap1 ), nBmpHeight( ::hBitmap1 ) ) 
      SetBkColor( ::hDC, nOldClr )
   else      
      PalBtnPaint ( ::hWnd, ::hBitmap1, ::hPalette1, ::hBitmap2, ::hPalette2,;
                ::hBitmap3, ::hPalette3, ::lPressed, ::lAdjust, ::lBorder,;
                ::oPopup != nil, ::nClrPane,  ::cCaption, ::nLayout,;
                If( ::oFont != nil, ::oFont:hFont, 0 ), ::nClrText, ::hDC )  
                    
   EndIf


Pero mis botones se ven asi :


Gracias
Posts: 158
Joined: Tue Oct 11, 2005 03:10 PM

SHAPE & TRANSPARENT Clause using TsButton

Posted: Thu Nov 30, 2006 09:57 PM
Sr. Linares
Aqui esta el codigo que utilizo en la clase TbtnBmp, Metodo PAINT()...

if ::lTransparent       
      hBmpOld = SelectObject( ::hDC, ::hBitmap1 ) 
      nZeroZeroClr = GetPixel( ::hDC, 0, 0 ) 
      SelectObject( ::hDC, hBmpOld ) 
      nOldClr = SetBkColor( ::hDC, nRGB( 255, 255, 255 ) ) 
      TransBmp( ::hBitmap1, nBmpWidth( ::hBitmap1 ), nBmpHeight( ::hBitmap1 ), nZeroZeroClr, ::hDC,; 
                If( ::lPressed, 2, 1 ), If( ::lPressed, 2, 1 ),;                 
                nBmpWidth( ::hBitmap1 ), nBmpHeight( ::hBitmap1 ) ) 
      SetBkColor( ::hDC, nOldClr )      
      
   else      
      PalBtnPaint( ::hWnd, ::hBitmap1, ::hPalette1, ::hBitmap2, ::hPalette2,;
                ::hBitmap3, ::hPalette3, ::lPressed, ::lAdjust, ::lBorder,;
                ::oPopup != nil, ::nClrPane,  ::cCaption, ::nLayout,;
                If( ::oFont != nil, ::oFont:hFont, 0 ), ::nClrText, ::hDC )  
                    
   EndIf
   
   //REGF HASTA AQUI

Cuando utilizo TRANSPARENT, el bitmap, lo coloca en la parte sup. izq. del boton.

 Le envie la imagen a su correo, porque al subirla al hyperload, subia 0 (cero) bytes. ( Aun no aprendo como utilizar esa herramienta ).

Gracias

Continue the discussion