Display Alpha channel 32 bit BMP on ButtonBMP (Solved)
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
Re: Display Alpha channel 32 bit BMP on ButtonBMP (Solved)
Anser,
The class changes are exactly the ones that I commented you at the beginning of this thread:
use ABPaint() instead of DrawMasked() in Method Paint(). Thats all
The class changes are exactly the ones that I commented you at the beginning of this thread:
use ABPaint() instead of DrawMasked() in Method Paint(). Thats all
Re: Display Alpha channel 32 bit BMP on ButtonBMP (Solved)
Yes Mr.Antonio, you are right. Unfortunately in between I got into trouble with the wrong .RES file issue and I was totally confused after that and went in the wrong direction.Anser,
The class changes are exactly the ones that I commented you at the beginning of this thread:
use ABPaint() instead of DrawMasked() in Method Paint(). Thats all
Really appreciate your support
One more question. Do I have to follow the similiar steps in METHOD PAINT of TBitMap to display AlphaChannel BMP on a BITMAP control ? Or is there any other control available to display AlphaChannel BMP on a Dialog/Window/Folder ?
Code: Select all
@04,14 BITMAP oBmp SIZE 43,55 of oFolder:aDialogs[1] RESOURCE "User76x112"
Regards
Anser
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
Re: Display Alpha channel 32 bit BMP on ButtonBMP (Solved)
Anser,
It is the same issue:
Just modify Class TBitmap Method Paint() to use ABPaint()
It is the same issue:
Just modify Class TBitmap Method Paint() to use ABPaint()
Re: Display Alpha channel 32 bit BMP on ButtonBMP (Solved)
Dear Mr.Antonio,
Is it
or
Would have been nice If we could control this from our PRG itself without modifying the original class
Regards
Anser
Which one should I replace with ABPaintJust modify Class TBitmap Method Paint() to use ABPaint()
Is it
Code: Select all
PalBmpDraw( ::hDC, ::nX, ::nY, ::hBitmap, ::hPalette,;
Super:nWidth(), Super:nHeight(),, ::lTransparent, ::nClrPane )
Code: Select all
TransBmp( ::hBitmap, ::nWidth(), ::nHeight(), nZeroZeroClr, ::hDC,;
::nX, ::nY, ::nWidth(), ::nHeight() )
Regards
Anser
Re: Display Alpha channel 32 bit BMP on ButtonBMP (Solved)
I tried,
But did't get the expected result
Regards
Anser
Code: Select all
@04,14 BITMAP oBmp SIZE 43,55 of oFolder:aDialogs[1] RESOURCE "User76x112"
oBmp:bPainted:={ || ABPaint( oBmp:hDC, 0, 0, oBmp:hBitmap, 220 )}
Regards
Anser
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
Re: Display Alpha channel 32 bit BMP on ButtonBMP (Solved)
Anser,
The idea is to modify the class, but if you want to test it that way then try it like this:
oBmp:bPainted:={ | hDC | ABPaint( hDC, 0, 0, oBmp:hBitmap, 220 ) }
The idea is to modify the class, but if you want to test it that way then try it like this:
oBmp:bPainted:={ | hDC | ABPaint( hDC, 0, 0, oBmp:hBitmap, 220 ) }
Re: Display Alpha channel 32 bit BMP on ButtonBMP (Solved)
Dear MR.Antonio,
Thankyou, solved
Had to replace both PalBmpDraw() and TransBmp() with ABPaint() in the Method Paint()
For Aesthetic purpose it is better to have a choice to use AlphaBmp's. Is it possible to include these changes in the future FWH updates with a Logical DATA to decide whether to display or not the AlphaChannel so that it does not effect backward compatibility.
Regards
Anser
Thankyou, solved
Had to replace both PalBmpDraw() and TransBmp() with ABPaint() in the Method Paint()
Code: Select all
IF ! ::lBmpAlpha // New Data .T. or .F.
TransBmp( ::hBitmap, ::nWidth(), ::nHeight(), nZeroZeroClr, ::hDC,;
::nX, ::nY, Super:nWidth(), Super:nHeight() )
Else
ABPaint( ::hDC, ::nX, ::nY, ::hBitmap, 220 )
Endif
Code: Select all
IF ! ::lBmpAlpha // New Data .T. or .F.
PalBmpDraw( ::hDC, ::nX, ::nY, ::hBitmap, ::hPalette,;
::nWidth(), ::nHeight(),, ::lTransparent, ::nClrPane )
Else
ABPaint( ::hDC, ::nX, ::nY, ::hBitmap, 220 )
Endif
Regards
Anser
- James Bott
- Posts: 4654
- Joined: Fri Nov 18, 2005 4:52 pm
- Location: San Diego, California, USA
- Contact:
Re: Display Alpha channel 32 bit BMP on ButtonBMP (Solved)
>For Aesthetic purpose it is better to have a choice to use AlphaBmp's. Is it possible to include these changes in the future FWH updates with a Logical DATA to decide whether to display or not the AlphaChannel so that it does not effect backward compatibility.
Antonio, I would like to vote for this also.
regards,
James
Antonio, I would like to vote for this also.
regards,
James
- Enrico Maria Giordano
- Posts: 7355
- Joined: Thu Oct 06, 2005 8:17 pm
- Location: Roma - Italia
- Contact:
- Giovany Vecchi
- Posts: 129
- Joined: Mon Jun 05, 2006 9:39 pm
- Location: Brasil
Re: Display Alpha channel 32 bit BMP on ButtonBMP (Solved)
Estou alterando a classe tOutLook para funcionar com Bmps Alpha channels tambem, quando estiver pronto eu aviso.
I am also altering the class tOutLook to work with Bmps Alpha channels, when it is ready I inform.
I am also altering the class tOutLook to work with Bmps Alpha channels, when it is ready I inform.
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
Re: Display Alpha channel 32 bit BMP on ButtonBMP (Solved)
Wouldn't it better if we could automatically detect if the bitmap has an alpha channel into it and automatically call the proper painting routine ?
Re: Display Alpha channel 32 bit BMP on ButtonBMP (Solved)
If it is possible to identify Alphachannel automatically then that would be the best solution.Antonio Linares wrote:Wouldn't it better if we could automatically detect if the bitmap has an alpha channel into it and automatically call the proper painting routine ?
Regards
Anser
- Enrico Maria Giordano
- Posts: 7355
- Joined: Thu Oct 06, 2005 8:17 pm
- Location: Roma - Italia
- Contact:
Re: Display Alpha channel 32 bit BMP on ButtonBMP (Solved)
Definitely!Antonio Linares wrote:Wouldn't it better if we could automatically detect if the bitmap has an alpha channel into it and automatically call the proper painting routine ?
EMG
- Giovany Vecchi
- Posts: 129
- Joined: Mon Jun 05, 2006 9:39 pm
- Location: Brasil
Re: Display Alpha channel 32 bit BMP on ButtonBMP (Solved)
I am not sure, but he/she should have this function so that it was detected automatically
http://msdn.microsoft.com/en-us/library ... S.85).aspx
http://msdn.microsoft.com/en-us/library ... S.85).aspx
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact: