SHAPE & TRANSPARENT Clause using TsButton

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

Aqui va

Post by ricardog »

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

Code: Select all

  // 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: 149
Joined: Tue Oct 11, 2005 3:10 pm

Post by ricardog »

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

Code: Select all

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
Post Reply