Page 1 of 1

Transparent images using image class

Posted: Mon Jan 23, 2006 8:06 am
by AlexSchaft
Hi,

I'm placing a logo on the mdi client space using the following code:

@ 5, 5 BITMAP oImage NAME "Bmp_Quick" PIXEL OF ::oWnd:oWndClient NOBORDER

oImage:lTransparent := .t.


This worked fine under FWH 2.6 June 2005. I've now loaded Jan 2006, and my logo has a black background. What should I do to fix it?

Alex

Posted: Mon Jan 23, 2006 9:06 am
by Antonio Linares
Alex,

Fixed. This minor fix is required on Class TBitmap:

Code: Select all

METHOD Paint() CLASS TBitmap

   local aInfo := ::DispBegin(), hBmpOld, nZeroZeroClr, nOldClr

   if ! ::lTransparent
      FillRect( ::hDC, GetClientRect( ::hWnd ), ::oBrush:hBrush )
   else   
      if ! IsAppThemed() .or. Upper( ::oWnd:ClassName() ) $ "TWINDOW;TMDICLIENT"
         SetBrushOrgEx( ::hDC, 8 - ::nLeft() % 8, 8 - ::nTop() % 8 )
         FillRect( ::hDC, GetClientRect( ::hWnd ), ::oWnd:oBrush:hBrush )
      else
         DrawPBack( ::hWnd, ::hDC )
      endif   
   endif 
   ...  
This is just the change:

... .or. Upper( ::oWnd:ClassName() ) $ "TWINDOW;TMDICLIENT"

Posted: Mon Jul 03, 2006 8:42 am
by AlexSchaft
Hi,

This has become a problem again. I see the line with "twindow;tmdiclient" is no longer there. What should the fix be now?

Alex

Posted: Mon Jul 03, 2006 9:30 am
by Antonio Linares
Alex,

What FWH version/build are you using ?

With FWH 2.7 June 2006 is working fine:
Image