'Transparency' in BMP for Image Buttons

Started by Peter2 · 2013-08-12 14:32 UTC · 11 replies · SMF topic #2005

I found some fine PNGs with transparency, and according to some postings here I filled the "transparent area" with colour 192,192,192 and saved them as BMP-24 bit.

Using these images (32x32) on image-buttons brings this result - not exactly what expected (see attachment, screenshot from Editor):

What's wrong?
Attachments
Transparency is tricky, and can work differently in different controls. On image buttons, I think you simply need original images with built-in transparency. Also, the Background Color and Style of the image button could affect how it displays (particularly the XP-themed style may be different).
author=owenwengerd link=topic=2005.msg9880#msg9880 date=1376318954 wrote:
...On image buttons, I think you simply need original images with built-in transparency. ...

So in this case no need to convert?

EDIT:
- I used the original PNG, and get a black background (in Preview and in dialogue)
- Then I imported the same BMP as before - and the "ugly grey background" disappeared.

Then I retried with another picture. I replaced ...
- the imported  BMP with the same(!) external BMP -> no changes.
- the imported BMP with the transparent PNG -> black background.
- the imported PNG with the same external BMP (see above) -> fine, transparent looking background.

Problems with refreshing?
Could you attach (or email if you don't want them in public) sample files that I can use to reproduce the problem?
author=owenwengerd link=topic=2005.msg9892#msg9892 date=1376353873 wrote:
Could you attach (or email if you don't want them in public) sample files that I can use to reproduce the problem?

Here they are ..
Attachments
I tried to reproduce the problem, but for me, the .png is always black background and the .bmp is always transparent. The visible graphic button on the open form in Studio does not update automatically after the picture folder changes, but that is by design. Is the .bmp displaying correctly for you at runtime?
author=owenwengerd link=topic=2005.msg9903#msg9903 date=1376405100 wrote:...Is the .bmp displaying correctly for you at runtime?

The "ugly" BMP was displayed in Editor on my PC and at runtime on other PCs. But this project had a lot of changes before - I defined 300 BMPs, removed them later, worked with PNG, then with the first draft of BMP. So maybe there was really a refreshing problem; for me it is OK now to know that color 192,192,192 works fine.
author=Peter2 link=topic=2005.msg9914#msg9914 date=1376430129 wrote:
...for me it is OK now to know that color 192,192,192 works fine.

Hmmmh, changed again. Now images which were fine yesterday have again the semi-dark background. New pictures which I added today are fine. Problem is in runtime (but in VMWare), the Editor seem to be OK.

I use the ODCL, saved-as-LSP and compiled to VLX - maybe there is a problem?

But the issue is not so important at the moment - I will keep on watching ...
If you can document steps to reproduce it reliably, please let me know so I can investigate.
Hi, a small hint: bmp are getting transparent when you use RGB 192,192,192 in the background. Don't use grading alpha colors (grading to transparent).

Regards, Fred
author=owenwengerd link=topic=2005.msg9916#msg9916 date=1376526091 wrote:
If you can document steps to reproduce it reliably, please let me know so I can investigate.

Yes, I will try. Maybe it is a problem of compilation ..

author=Fred Tomke link=topic=2005.msg9917#msg9917 date=1376549377 wrote:
Hi, a small hint: bmp are getting transparent when you use RGB 192,192,192 in the background.

This is what I did. I open the PNG, filled the transparent area around with 192,192,192 and saved as BMP.

author=Fred Tomke link=topic=2005.msg9917#msg9917 date=1376549377 wrote:
Don't use grading alpha colors (grading to transparent).

???
Some posts above I added some pictures. Could you take a look to check them?

EDIT:
All the BMP have 350-450 colours which is a little bit crazy. I start to test a reduction to 16 colours.
author=Peter2 link=topic=2005.msg9922#msg9922 date=1376580666 wrote:
[quote author=Fred Tomke link=topic=2005.msg9917#msg9917 date=1376549377]
Don't use grading alpha colors (grading to transparent).

???
Some posts above I added some pictures. Could you take a look to check them?


Yes, I've seen {2} and thought you wanted to get a gradiation to transparent under the arrow.

I usually use icons. You can save your pictures with transparent background to ICO file using Gimp.

Regards, Fred