Page 2 of 4

Re: Display Alpha channel 32 bit BMP on ButtonBMP

PostPosted: Sat Jan 03, 2009 10:28 am
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 viewtopic.php?f=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

Re: Display Alpha channel 32 bit BMP on ButtonBMP

PostPosted: Sat Jan 03, 2009 12:39 pm
by hua
Are you certain in your xMate the .rc got compiled and the resultant .res is linked in? Just a thought.

Re: Display Alpha channel 32 bit BMP on ButtonBMP

PostPosted: Sat Jan 03, 2009 1:17 pm
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
viewtopic.php?f=3&t=14148

Regards

Anser

Re: Display Alpha channel 32 bit BMP on ButtonBMP

PostPosted: Sat Jan 03, 2009 3:25 pm
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.

Re: Display Alpha channel 32 bit BMP on ButtonBMP

PostPosted: Mon Jan 05, 2009 6:45 am
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

Re: Display Alpha channel 32 bit BMP on ButtonBMP

PostPosted: Mon Jan 05, 2009 7:47 am
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 :-)

Re: Display Alpha channel 32 bit BMP on ButtonBMP

PostPosted: Mon Jan 05, 2009 8:04 am
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

Re: Display Alpha channel 32 bit BMP on ButtonBMP

PostPosted: Mon Jan 05, 2009 8:40 am
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

Re: Display Alpha channel 32 bit BMP on ButtonBMP

PostPosted: Mon Jan 05, 2009 9:08 am
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).

Re: Display Alpha channel 32 bit BMP on ButtonBMP

PostPosted: Mon Jan 05, 2009 9:34 am
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  Expand view
%C_BIN_INSTALL%\Brc32.Exe -r  -fo%RES%  %RC%

To
Code: Select all  Expand view
C:\PellesC\Bin\PORC.EXE  %RC%   /I C:\pellesc\include /I C:\pellesc\include\win


Image

Regards

Anser

Re: Display Alpha channel 32 bit BMP on ButtonBMP

PostPosted: Mon Jan 05, 2009 11:17 am
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

Re: Display Alpha channel 32 bit BMP on ButtonBMP

PostPosted: Mon Jan 05, 2009 11:41 am
by Antonio Linares
Anser,

Glad to know that you solved it :-)

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

Re: Display Alpha channel 32 bit BMP on ButtonBMP

PostPosted: Mon Jan 05, 2009 3:09 pm
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

Re: Display Alpha channel 32 bit BMP on ButtonBMP

PostPosted: Tue Jan 06, 2009 1:44 am
by fraxzi
Here's a good one:

Code: Select all  Expand view
...
@ 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  Expand view
...
alpha32   BITMAP DISCARDABLE "D:/FWH812/bitmaps/AlphaBmp/world.bmp"
...


Image


Thanks Giovany!!!

Regards,

Re: Display Alpha channel 32 bit BMP on ButtonBMP

PostPosted: Tue Jan 06, 2009 4:13 am
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