Display Alpha channel 32 bit BMP on ButtonBMP (Solved)

User avatar
anserkk
Posts: 1280
Joined: Fri Jun 13, 2008 11:04 am
Location: Kochi, India

Re: Display Alpha channel 32 bit BMP on ButtonBMP

Post by anserkk »

Dear Mr.Antonio,

The BMP is getting displayed on ButtonBMP control without any changes in the original class.

It was my mistake and I am extremely sorry for this.

I used xMate to build my project. Something wrong with my settings in xMate. Till now I am not able to resolve it

I am puzzled and I don't know where I have went wrong with xMate

When I build my project with xMate:-
1) My exe does not display AlphaBMP 32bit BMP on ButtonBMP
2) My exe gives CreateDlgError when I try to open a Dialog created using the resource builder ResEd.

When I used the modified version of .rmk available in the folder \FWH\makes\bormake.zip everything worked fine. ( Only the resource compiler changed to Pelles )

I had opened another topic http://forums.fivetechsupport.com/viewt ... =3&t=14148 regarding the CreateDlgError and ResEd. When I changed xMate to .rmk this problem too got solved.

Any hint what could be wrong ?

Regards

Anser
hua
Posts: 861
Joined: Fri Oct 28, 2005 2:27 am

Re: Display Alpha channel 32 bit BMP on ButtonBMP

Post by hua »

Are you certain in your xMate the .rc got compiled and the resultant .res is linked in? Just a thought.
FWH 11.08/FWH 19.03
xHarbour 1.2.1 (Rev 6406) + BCC
Harbour 3.1 (Rev 17062) + BCC
Harbour 3.2.0dev (r1904111533) + BCC
User avatar
anserkk
Posts: 1280
Joined: Fri Jun 13, 2008 11:04 am
Location: Kochi, India

Re: Display Alpha channel 32 bit BMP on ButtonBMP

Post by anserkk »

Are you certain in your xMate the .rc got compiled and the resultant .res is linked in? Just a thought.
Yes, the .RC is getting compiled and all the images contained in the .RC are getting displayed on other controls except the 32 bit BMP. The Dialog from Resources gives a run time error CreateDlgError.

This happens only when xMate is used to buid the project. If .rmk then everything working fine. I really don't understand where I have went wrong.

Definitely it's my configuration mistake in xMate, because Mr.Fraxzy is able to use xMate with the resource editor ResEd

I have posted the contents of my xMate project file in the following link
http://www.forums.fivetechsupport.com/v ... =3&t=14148

Regards

Anser
User avatar
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

Post by Antonio Linares »

Anser,

Please open you EXE with Pelles and check if all your resources are inside the EXE, when you build it using xMate.
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
anserkk
Posts: 1280
Joined: Fri Jun 13, 2008 11:04 am
Location: Kochi, India

Re: Display Alpha channel 32 bit BMP on ButtonBMP

Post by anserkk »

Dear Mr.Antonio,
Please open you EXE with Pelles and check if all your resources are inside the EXE, when you build it using xMate.
I did not find an option in Pelles to open an EXE to find out it's resources. When I opened .RES file with the ResEdit (Another free resource editor which allows to open .RES file), I found that ResEdit was able to Re-create all the BMPS and even the Dialog from the .RES file

From this I understand that PellesC is compiling the .RC file and creating .RES file.
Other images contained in the same .RC files of this project are displayed on other controls in my EXE.

I have gone really crazy tying to solve this. I think I should take a break. :D

Regards

Anser
User avatar
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

Post by Antonio Linares »

Anser,

> I did not find an option in Pelles to open an EXE

Just click the "open" button and select the name of your exe (i.e. MyApp.exe )

Then you will see all the resources embedded into the EXE :-)
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
anserkk
Posts: 1280
Joined: Fri Jun 13, 2008 11:04 am
Location: Kochi, India

Re: Display Alpha channel 32 bit BMP on ButtonBMP

Post by anserkk »

Dear Mr.Antonio,

Thankyou for the info, I opened the exe with Pelles
You are right the specific BMP and the Dialog does not exist in the Exe

Now what could be wrong ? Is it the Linking part ?

in .RES file it is there ?. Any hint ?

Regards

Anser
User avatar
anserkk
Posts: 1280
Joined: Fri Jun 13, 2008 11:04 am
Location: Kochi, India

Re: Display Alpha channel 32 bit BMP on ButtonBMP

Post by anserkk »

Dear Mr.Antonio,

Screen Snapshots

1. Exe created using \FWH\Bormake and Opened on PellesC All resources exist ie Dialog and AnsTest.BMP
Image

2. Exe created using xMate and Opened on PellesC Missing resources ie Dialog and AnsTest.BMP
Image

3. .RES file created by PellesC. This .RES file is used in xMate All resources exist ie Dialog and AnsTest.BMP
Image

Is there any specific parameters to be taken care while executing the link command ?

I wonder why this particular BMP and DIALOG is missing from the EXE, the rest of the resources are getting added to the EXE :D

Regards

Anser
User avatar
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

Post by Antonio Linares »

Anser,

I assume that:

1. You keep your resources in a RC file.

2. You use xMate to create the RES file from the RC file.

if yes, then please use Pelles to inspect the RES file created from xMate, and check what there is inside it.

Is xMate calling Borland brc32.exe to create the RES file ? (sorry, we don't use xMate here, we use UEStudio).
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
anserkk
Posts: 1280
Joined: Fri Jun 13, 2008 11:04 am
Location: Kochi, India

Re: Display Alpha channel 32 bit BMP on ButtonBMP

Post by anserkk »

Antonio Linares wrote:Anser,

I assume that:

1. You keep your resources in a RC file.
Yes
Antonio Linares wrote:2. You use xMate to create the RES file from the RC file.

if yes, then please use Pelles to inspect the RES file created from xMate, and check what there is inside it.
The 3 rd image which I have posted in my previous post is the screen snapshot of the .RES file created by the PellesC Resource compiler. When Opened with PellesC it shows that the 32 bit BMP "AnsTest" and the DIALOG exists in the .RES file

Image
Antonio Linares wrote:Is xMate calling Borland brc32.exe to create the RES file ? (sorry, we don't use xMate here, we use UEStudio).
No, in xMate Environment file I have changed the resource compiler part command from Borland to PellesC

From

Code: Select all

%C_BIN_INSTALL%\Brc32.Exe -r  -fo%RES%  %RC%
To

Code: Select all

C:\PellesC\Bin\PORC.EXE  %RC%   /I C:\pellesc\include /I C:\pellesc\include\win
Image

Regards

Anser
User avatar
anserkk
Posts: 1280
Joined: Fri Jun 13, 2008 11:04 am
Location: Kochi, India

Re: Display Alpha channel 32 bit BMP on ButtonBMP

Post by anserkk »

Dear Antonio,

Problem solved. I deleted the xMate Project and re-created it.
xMate by default will create certain folders inside our project folder. xMate author has adviced not to delete these folders and has asked to leave as it is.

The sub folders created by xMate in our project directory are :-
Backup
Bin
Debug
Include
Lib
Obj
Resource
Source

I don't know how it happened, I found a .RES file copied inside the Resource folder and it was that .RES file getting linked to my EXE :shock: . May be a copy made by xMate itslef when some error occured will creating the .RES file, I guess. I understand that if .RES file exists in the RESOURCE folder then xMate will link that .RES file with the EXE and ignores the .RES file compiled and generated in the project folder. I deleted the .RES file from the folder RESOURCE and everything worked as expected.

Anyway it is a good lesson. I am writing it down here so that it may be useful for beginners like me :D .

Thanks for your effort.

Regards

Anser
User avatar
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

Post by Antonio Linares »

Anser,

Glad to know that you solved it :-)

Thanks for sharing that valuable info for other xMate users :-)
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Giovany Vecchi
Posts: 129
Joined: Mon Jun 05, 2006 9:39 pm
Location: Brasil

Re: Display Alpha channel 32 bit BMP on ButtonBMP

Post by Giovany Vecchi »

Eu fiz algumas alterações na classe pra funcionar com bmps alpha channels

http://www.fivewin.com.br/exibedicas.asp?id=924

ex:
oBtnBmp:lBmpAlpha := .T.
anserkk wrote:Hi,

I understand that Borland Resource Compiler does not support Alpha channel BMP's, I have used "Pelles C" resource compiler to compile the .RC file without any error's.

Unfortunately the ButtonBMP is not displaying the image. (No errors).

I hope ButtonBMP support's 32bit Alpha BMP's.

Any hint?

Regards

Anser
User avatar
fraxzi
Posts: 811
Joined: Tue May 06, 2008 4:28 am
Location: Philippines
Contact:

Re: Display Alpha channel 32 bit BMP on ButtonBMP

Post by fraxzi »

Here's a good one:

Code: Select all

...
@ 50, 50 BUTTONBMP aBtn1[4] OF oMDIFrame:oWndClient BITMAP 'alpha32' PIXEL

@ 50, 200 BUTTONBMP aBtn1[5] OF oMDIFrame:oWndClient BITMAP 'alpha32' PIXEL
                                  aBtn1[5]:lBmpAlpha := .T.
...
.RC

Code: Select all

...
alpha32   BITMAP DISCARDABLE "D:/FWH812/bitmaps/AlphaBmp/world.bmp"
...
Image


Thanks Giovany!!!

Regards,
Kind Regards,
Frances

Fivewin for xHarbour v18.07
xHarbour v1.2.3.x
BCC 7.3 + PellesC8 ( Resource Compiler only)
ADS 10.1 / MariaDB
Crystal Reports 8.5/9.23 DE
xMate v1.15
User avatar
anserkk
Posts: 1280
Joined: Fri Jun 13, 2008 11:04 am
Location: Kochi, India

Re: Display Alpha channel 32 bit BMP on ButtonBMP

Post by anserkk »

Thanks Giovany!!!

The control is displaying AlphaChannels.
Eu fiz algumas alterações na classe pra funcionar com bmps alpha channels

http://www.fivewin.com.br/exibedicas.asp?id=924

ex:
oBtnBmp:lBmpAlpha := .T.
Regards

Anser
Post Reply