SHAPE & TRANSPARENT Clause using TsButton

Aqui va

Postby ricardog » Thu Nov 30, 2006 9:33 pm

Así explica ud que se hiciera la correcion en el
METHOD PAINT() //de TBtnBmp

Code: Select all  Expand view
  // 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 :
Image

Gracias
ricardog
 
Posts: 158
Joined: Tue Oct 11, 2005 3:10 pm

Postby ricardog » Thu Nov 30, 2006 9:57 pm

Sr. Linares
Aqui esta el codigo que utilizo en la clase TbtnBmp, Metodo PAINT()...

Code: Select all  Expand view
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
ricardog
 
Posts: 158
Joined: Tue Oct 11, 2005 3:10 pm

Previous

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot], nageswaragunupudi and 59 guests