Page 1 of 1

Problem with bitmaps - to Antonio

PostPosted: Mon Apr 13, 2009 11:20 am
by driessen
Hello,

I have these codes, concerning bitmaps:
Code: Select all  Expand view
MsgInfo(FILE("..\BITMAPS\JUDA.BMP"))
MsgLogo("..\BITMAPS\JUDA.BMP",5)

Code: Select all  Expand view
MsgInfo(FILE("..\BITMAPS\CURRENT.BMP"))
DEFINE BUTTON OF oBAR FILE "..\BITMAPS\CURRENT.BMP" ACTION (EditDos("Update",1,.F.))

In both cases, the first lines results in a ".T.", which means that the file exist.
But in the second lines, the bitmaps don't appear on my screen. The button in the second case is working fine though.

It becomes more strange. Until now the problem only occurs if I use my application through Terminal Services on a Windows 2003 Server. The problem doesn't happen on a workstation until now.

I use FWH 9.04 and xHarbour Builder April 2009.

What is the reason for this problem ? Memory ?

Thanks a lot in advance for any help.

Re: Problem with bitmaps

PostPosted: Mon Apr 13, 2009 12:20 pm
by ukoenig
In my Applications I don't work with ..\, because sometimes a file was not found.
Maybe in Your different situations, the BMP wasn't found.
On top of my Application, I define the Procect-path.

c_dir := GetModuleFilename(GetInstance(),"MYAPPLICATION.EXE" + CHR(0), 255)
c_path := left ( c_dir, rat( "\", c_dir) -1 )


That allways works :
myfile := c_path + "\FWHVERS.MEM"
myBMP := c_path + "\IMAGES\MyBMP.bmp"

Maybe it helps.

Regards
Uwe :lol:

Re: Problem with bitmaps

PostPosted: Mon Apr 13, 2009 12:36 pm
by driessen
Uwe,

Thanks a lot for your help.

But I'm afraid that the cause of the problem is not to be found in the place of the bitmap.

As you can see in my example, I test the existance of the bitmap which always results into ".T.".

I use this function already for 10 years and I never had any problem.

Any idea ?

Re: Problem with bitmaps - to Antonio

PostPosted: Tue Apr 14, 2009 8:53 am
by driessen
Antonio,

Do you have any idea why this problem occurs ?

Thanks.

Re: Problem with bitmaps - to Antonio

PostPosted: Tue Apr 14, 2009 10:44 am
by Taavi
Hello,
we also have 2 reports about disappearing bitmaps (TBtnBmp) after FWH and XHb upgrade but with bitmaps linked in from resource file. One of them on TS.

Customer's IT support was able to get bitmaps appearing after switching 16-bit colors to 32-bit in workstation Screen properties.

Can You check Your video card Color quality settings?

Best,
Taavi.



driessen wrote:Hello,

I have these codes, concerning bitmaps:
Code: Select all  Expand view
MsgInfo(FILE("..\BITMAPS\JUDA.BMP"))
MsgLogo("..\BITMAPS\JUDA.BMP",5)

Code: Select all  Expand view
MsgInfo(FILE("..\BITMAPS\CURRENT.BMP"))
DEFINE BUTTON OF oBAR FILE "..\BITMAPS\CURRENT.BMP" ACTION (EditDos("Update",1,.F.))

In both cases, the first lines results in a ".T.", which means that the file exist.
But in the second lines, the bitmaps don't appear on my screen. The button in the second case is working fine though.

It becomes more strange. Until now the problem only occurs if I use my application through Terminal Services on a Windows 2003 Server. The problem doesn't happen on a workstation until now.

I use FWH 9.04 and xHarbour Builder April 2009.

What is the reason for this problem ? Memory ?

Thanks a lot in advance for any help.

Re: Problem with bitmaps - to Antonio

PostPosted: Tue Apr 14, 2009 11:51 am
by driessen
Taavi,

Thanks a lot for your suggestion.

But I'm afraid that this is not the reason for my problem.

Meanwhile, I recompiled my application with FWH 9.03 and xHarbour Builder April 2009 and everything is OK now.

So, to my simple mind, the reason must be somewhere inside FWH 9.04.

Re: Problem with bitmaps - to Antonio

PostPosted: Tue Apr 14, 2009 11:57 am
by Antonio Linares
Michel,

Could you please email me JUDA.BMP ? thanks

Re: Problem with bitmaps - to Antonio

PostPosted: Tue Apr 14, 2009 1:09 pm
by driessen
Antonio,

I'll send you "JUDA.BMP" and "CURRENT.BMP" by e-mail.

Thanks.

Re: Problem with bitmaps - to Antonio

PostPosted: Tue Apr 14, 2009 5:19 pm
by Antonio Linares
Michel,

We are going to review them.

In the meantime, would you mind to add this function to your main PRG and test it again ? thanks
Code: Select all  Expand view

function HasAlpha( hBmp )

return .F.
 

Re: Problem with bitmaps - to Antonio

PostPosted: Tue Apr 14, 2009 6:26 pm
by Taavi
Hi,
in our tests setting desktop color quality to 16-bit makes bitmaps disappear with FWH 9.04.

Taavi



driessen wrote:Taavi,

Thanks a lot for your suggestion.

But I'm afraid that this is not the reason for my problem.

Meanwhile, I recompiled my application with FWH 9.03 and xHarbour Builder April 2009 and everything is OK now.

So, to my simple mind, the reason must be somewhere inside FWH 9.04.

Re: Problem with bitmaps - to Antonio

PostPosted: Tue Apr 14, 2009 10:15 pm
by Antonio Linares
Taavi,

We found what is going on:

HasAlpha() is failing under 16 bits colors resolution and is returning a wrong value, so they get managed as alpha bitmaps when they aren't.

We need to detect if we are under 16 bits colors and return false. We are working to improve HasAlpha() for this case.

In the meantime, please add this function to your main PRG. It should solve the problem:
Code: Select all  Expand view

function HasAlpha( hBmp )

return .F.
 

Re: Problem with bitmaps - to Antonio

PostPosted: Tue Apr 14, 2009 11:25 pm
by Antonio Linares
Taavi, Michel,

We have just published a new FWH 9.04 build that provides an improved function HasAlpha().

Please download it. We appreciate your feedback, thanks

Re: Problem with bitmaps - to Antonio

PostPosted: Wed Apr 15, 2009 8:22 am
by driessen
Antonio,

Thanks a lot for your efforts.

I'll do the download followed by the necessary tests.

I'll let you know the results here.

Thanks.

Re: Problem with bitmaps - to Antonio

PostPosted: Wed Apr 15, 2009 10:07 am
by driessen
Antonio, Taavi,

GOOD NEWS.

The problem seems to be solved. My bitmaps are shown again.

Thank you very much for your efforts.

Antonio, until now no problems with the TGET-class.

Thanks.

Re: Problem with bitmaps - to Antonio

PostPosted: Wed Apr 15, 2009 10:53 am
by Antonio Linares
Michel,

Glad to know it is working fine :-)

Many thanks for your feedback