Transparent images using image class

Post Reply
User avatar
AlexSchaft
Posts: 172
Joined: Fri Oct 07, 2005 1:29 pm
Location: Edenvale, Gauteng, South Africa

Transparent images using image class

Post 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
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Post 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"
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
AlexSchaft
Posts: 172
Joined: Fri Oct 07, 2005 1:29 pm
Location: Edenvale, Gauteng, South Africa

Post 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
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Post by Antonio Linares »

Alex,

What FWH version/build are you using ?

With FWH 2.7 June 2006 is working fine:
Image
regards, saludos

Antonio Linares
www.fivetechsoft.com
Post Reply