Method SetText() Transparent

Method SetText() Transparent

Postby Dorneles » Sun Sep 21, 2008 10:13 pm

http://img179.imageshack.us/my.php?image=tela1oc3.png

Changed the METHOD SetText( cText ) not to exceeding the limit as shown in Image 1, only that he lost his transparency, lack what?

Code: Select all  Expand view
METHOD SetText( cText ) CLASS TSSay

   local hDC , nWidth

   DEFAULT ::lTransparent := .f.

   ::cCaption := If( ::cPicture != nil,;
                    Transform( cText, ::cPicture ),;
                    cValToChar( cText ) )
                     
   if ! lAnd( GetWindowLong( ::hWnd, GWL_STYLE ), nOr( SS_LEFT, SS_RIGHT, SS_CENTER ) )
      nWidth = GetTextWidth( 0, ::cCaption, If( ::oFont != nil, ::oFont:hFont,) ) 
      IF nWidth > ::nWidth
         nWidth = GetTextWidth( 0, ::cCaption, If( ::oFont != nil, ::oFont:hFont,) ) -(GetTextWidth( 0, ::cCaption, If( ::oFont != nil, ::oFont:hFont,) ) - ::nWidth)
      ENDIF
      if nWidth > ::nWidth
         ::nWidth = nWidth
      endif   
   endif   
   
   SetWindowText( ::hWnd, ::cCaption )

return nil
Dorneles
 
Posts: 30
Joined: Mon Oct 30, 2006 2:39 pm
Location: Brasil

Postby Dorneles » Wed Sep 24, 2008 1:29 am

The image 2 this with the gray background, I make it transparent.
Dorneles
 
Posts: 30
Joined: Mon Oct 30, 2006 2:39 pm
Location: Brasil

Postby Silvio » Wed Sep 24, 2008 12:05 pm

Dear Dorneles,

STATIC FUNCTION DrawText2( hDC, hFont, nBkMode, cText, nTop, nLeft, nWidth, nHeight )
LOCAL hFontOld:= SelectObject( hDC, hFont )
LOCAL nBkOld := SetBkMode( hDC, nBkMode )
DrawText( hDC, cText, { nTop, nLeft, nTop+nWidth, nLeft+nHeight } )
SelectObject( hDC, hFontOld )
SetBkMode( hDC, nBkOld )
RETURN( NIL )


it write trasparent on bitmap
Best Regards, Saludos

Falconi Silvio
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: No registered users and 63 guests