BBC BASIC for Windows
« Transparent images in dialogue box »

Welcome Guest. Please Login or Register.
Apr 5th, 2018, 9:56pm



ATTENTION MEMBERS: Conforums will be closing it doors and discontinuing its service on April 15, 2018.
Ad-Free has been deactivated. Outstanding Ad-Free credits will be reimbursed to respective payment methods.

If you require a dump of the post on your message board, please come to the support board and request it.


Thank you Conforums members.

BBC BASIC for Windows Resources
Online BBC BASIC for Windows documentation
BBC BASIC for Windows Beginners' Tutorial
BBC BASIC Home Page
BBC BASIC on Rosetta Code
BBC BASIC discussion group
BBC BASIC for Windows Programmers' Reference

« Previous Topic | Next Topic »
Pages: 1  Notify Send Topic Print
 thread  Author  Topic: Transparent images in dialogue box  (Read 321 times)
JB91
New Member
Image


member is offline

Avatar




PM

Gender: Male
Posts: 47
xx Transparent images in dialogue box
« Thread started on: Mar 11th, 2017, 8:17pm »

Hello,

The main help documentation describes how to display a bitmap image in a dialogue box, however, it cannot seem to display images with a transparent background properly.

How could you adapt the code to display a transparent image?

Thanks,
Josh
User IP Logged

DDRM
Administrator
ImageImageImageImageImage


member is offline

Avatar




PM

Gender: Male
Posts: 321
xx Re: Transparent images in dialogue box
« Reply #1 on: Mar 11th, 2017, 9:11pm »

Hi Josh,

I found a page here:

http://stackoverflow.com/questions/3988484/how-to-load-a-png-resource-into-picture-control-on-a-dialog-box

that might be useful. It suggests that it should be possible using a 32 BPP bitmap with transparency data - is that what you have tried?

You might be better asking Richard, on the crossplatform conforum - he has absented himself from this one. Your best bet here is probably David Williams - David, any thoughts?

Best wishes,

D
User IP Logged

David Williams
Developer

member is offline

Avatar

meh


PM

Gender: Male
Posts: 452
xx Re: Transparent images in dialogue box
« Reply #2 on: Mar 12th, 2017, 03:07am »

I have no experience with programming Windows dialogue boxes or windowed applications. I agree that it would be worthwhile asking Richard.
User IP Logged

JB91
New Member
Image


member is offline

Avatar




PM

Gender: Male
Posts: 47
xx Re: Transparent images in dialogue box
« Reply #3 on: Mar 17th, 2017, 6:09pm »

Quote:
It suggests that it should be possible using a 32 BPP bitmap with transparency data - is that what you have tried?

Only certain types of .bmp files seem to work with the LoadImage SYS call I have been using:

Code:
SYS "LoadImage", 0, "image.bmp", 0, cx%, cy%, LR_LOADFROMFILE TO hbitmap% 

But I'm not too sure which types of .bmp files work.

However, here is a link to a solution from Richard over on the other forum...

http://bbcbasic.conforums.com/index.cgi?action=display&board=ui&num=1489341301&start=0#1489334581

Thanks,
Josh
User IP Logged

KenDown
Full Member
ImageImageImage


member is offline

Avatar




PM


Posts: 181
xx Re: Transparent images in dialogue box
« Reply #4 on: Mar 22nd, 2017, 5:48pm »

I don't know how you are generating your images. I know that when I use the Gimp and tell it to save a .bmp image, it comes up with half a dozen different options, only one of which works with BBC BASIC (or perhaps, with Windows). The trouble is that I can't remember what the preferred options are - I must write them down next time I do it - but a bit of experimenting will get you there in the end.

Oh, and the easiest way of producing a transparent image is to create a new layer from visible, then make the lower layer invisible (click on the eye symbol up on top right) and delete the areas in the top layer that you want to be invisible.
User IP Logged

Pages: 1  Notify Send Topic Print
« Previous Topic | Next Topic »

| |

This forum powered for FREE by Conforums ©
Terms of Service | Privacy Policy | Conforums Support | Parental Controls