OpenDCL Forums

OpenDCL => Studio/Dialog Editor => Topic started by: Peter2 on August 12, 2013, 07:32:08 AM

Title: 'Transparency' in BMP for Image Buttons
Post by: Peter2 on August 12, 2013, 07:32:08 AM
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?
Title: Re: 'Transparency' in BMP for Image Buttons
Post by: owenwengerd on August 12, 2013, 07:49:14 AM
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).
Title: Re: 'Transparency' in BMP for Image Buttons
Post by: Peter2 on August 12, 2013, 08:01:06 AM
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?
Title: Re: 'Transparency' in BMP for Image Buttons
Post by: 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?
Title: Re: 'Transparency' in BMP for Image Buttons
Post by: Peter2 on August 12, 2013, 10:08:09 PM
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 ..
Title: Re: 'Transparency' in BMP for Image Buttons
Post by: owenwengerd on August 13, 2013, 07:45:00 AM
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?
Title: Re: 'Transparency' in BMP for Image Buttons
Post by: Peter2 on August 13, 2013, 02:42:09 PM
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.
Title: Re: 'Transparency' in BMP for Image Buttons
Post by: Peter2 on August 14, 2013, 02:51:39 PM
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 ...
Title: Re: 'Transparency' in BMP for Image Buttons
Post by: 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.
Title: Re: 'Transparency' in BMP for Image Buttons
Post by: 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. Don't use grading alpha colors (grading to transparent).

Regards, Fred
Title: Re: 'Transparency' in BMP for Image Buttons
Post by: Peter2 on August 15, 2013, 08:31:06 AM
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.
Title: Re: 'Transparency' in BMP for Image Buttons
Post by: Fred Tomke on August 15, 2013, 08:59:48 AM
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 (http://www.opendcl.com/forum/index.php?action=dlattach;topic=2005.0;attach=1895) 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