BBC BASIC
« Transparent images in a dialogue box »

Welcome Guest. Please Login or Register.
Mar 31st, 2018, 10:46pm



ATTENTION MEMBERS: Conforums will be closing it doors and discontinuing its service on April 15, 2018.
We apologize Conforums does not have any export functions to migrate data.
Ad-Free has been deactivated. Outstanding Ad-Free credits will be reimbursed to respective payment methods.

Thank you Conforums members.
Cross-platform BBC BASIC (Windows, Linux x86, Mac OS-X, Android, iOS, Raspberry Pi)
BBC BASIC Resources
BBC BASIC Help Documentation
BBC BASIC for Windows Home Page
BBC BASIC Programmers' Reference
BBC BASIC Beginners' Tutorial
BBC BASIC for SDL 2.0 Home Page
BBC BASIC Discussion Group

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


member is offline

Avatar




PM

Gender: Male
Posts: 2
xx Transparent images in a dialogue box
« Thread started on: Mar 12th, 2017, 4:03pm »

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

Richard Russell
Administrator
ImageImageImageImageImage


member is offline

Avatar




Homepage PM


Posts: 803
xx Re: Transparent images in a dialogue box
« Reply #1 on: Mar 12th, 2017, 5:42pm »

on Mar 12th, 2017, 4:03pm, JB91 wrote:
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.

To do that you need to replace the .BMP image (which is opaque) with a .ICO image (which can have transparent regions). You also need to change the SS_BITMAP stylebit to SS_ICON, and change the first parameter of the STM_SETIMAGE message from IMAGE_BITMAP to IMAGE_ICON:

Code:
LR_LOADFROMFILE = 16STM_SETIMAGE = 370IMAGE_ICON = 1SYS "LoadImage", 0, icofile$, IMAGE_ICON, cx%, cy%, LR_LOADFROMFILE TO hicon%SYS "SendDlgItemMessage", !dlg%, id%, STM_SETIMAGE, IMAGE_ICON, hicon% 

This is very similar to the process for Displaying an icon on a pushbutton documented at the Wiki here.

Richard.
User IP Logged

JB91
New Member
Image


member is offline

Avatar




PM

Gender: Male
Posts: 2
xx Re: Transparent images in a dialogue box
« Reply #2 on: Mar 13th, 2017, 11:54am »

Thank you, Richard. I converted the .bmp images to .ico and it works great!

Thanks,
Josh.
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