'Transparency' in BMP for Image Buttons

Started by Peter2, August 12, 2013, 07:32:08 AM

Previous topic - Next topic

Peter2

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?
Peter
ODCL 8.1.... German, AutoCAD 2017 - 2018, Win 7 x64, Win 10

owenwengerd

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).
Owen Wengerd (Outside The Box) / ManuSoft

Peter2

#2
Quote from: owenwengerd on August 12, 2013, 07:49:14 AM
...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?
Peter
ODCL 8.1.... German, AutoCAD 2017 - 2018, Win 7 x64, Win 10

owenwengerd

Could you attach (or email if you don't want them in public) sample files that I can use to reproduce the problem?
Owen Wengerd (Outside The Box) / ManuSoft

Peter2

Quote from: owenwengerd on August 12, 2013, 05:31:13 PM
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 ..
Peter
ODCL 8.1.... German, AutoCAD 2017 - 2018, Win 7 x64, Win 10

owenwengerd

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?
Owen Wengerd (Outside The Box) / ManuSoft

Peter2

Quote from: owenwengerd on August 13, 2013, 07:45:00 AM...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.
Peter
ODCL 8.1.... German, AutoCAD 2017 - 2018, Win 7 x64, Win 10

Peter2

Quote from: Peter2 on August 13, 2013, 02:42:09 PM
...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 ...
Peter
ODCL 8.1.... German, AutoCAD 2017 - 2018, Win 7 x64, Win 10

owenwengerd

If you can document steps to reproduce it reliably, please let me know so I can investigate.
Owen Wengerd (Outside The Box) / ManuSoft

Fred Tomke

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
Fred Tomke
Dipl.-Ing. (FH) Landespflege

[ landscaper - landscape developer - digital landscape and urban design]

Peter2

#10
Quote from: owenwengerd on August 14, 2013, 05:21:31 PM
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 ..

Quote from: Fred Tomke on August 14, 2013, 11:49:37 PM
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.

Quote from: Fred Tomke on August 14, 2013, 11:49:37 PM
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.
Peter
ODCL 8.1.... German, AutoCAD 2017 - 2018, Win 7 x64, Win 10

Fred Tomke

Quote from: Peter2 on August 15, 2013, 08:31:06 AM
Quote from: Fred Tomke on August 14, 2013, 11:49:37 PM
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 this image 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
Fred Tomke
Dipl.-Ing. (FH) Landespflege

[ landscaper - landscape developer - digital landscape and urban design]