Making a parts of a bitmap transparent

H

Henry van der Beek

Hello,

I am trying to make a backgammon app using VBA. The board and counters
are images with bitmaps loaded into their picture attributes, loaded
onto a UserForm.

The pieces are round, and the bitmap is a coloured circle on a white
background. However, when I load the bitmap into the userform, the
white edges of the image, which would be transparent in paintbrush,
appear as white on the userform. What I'd like is for these pixels to
be transparent so that you can see the board behind them.

Does anyone know of how I can make these pixels transparent, either in
the code or in paintbrush. Any help would be much appreciated.

Thank you,

Henry van der Beek
 
K

Karl E. Peterson

Henry said:
Hello,

I am trying to make a backgammon app using VBA. The board and counters
are images with bitmaps loaded into their picture attributes, loaded
onto a UserForm.

The pieces are round, and the bitmap is a coloured circle on a white
background. However, when I load the bitmap into the userform, the
white edges of the image, which would be transparent in paintbrush,
appear as white on the userform. What I'd like is for these pixels to
be transparent so that you can see the board behind them.

Does anyone know of how I can make these pixels transparent, either in
the code or in paintbrush. Any help would be much appreciated.

You'll probably have to do what's commonly called a Transparent BitBlt. I have some
standard VB code that's likely to be fairly adaptable, other than determining the
proper device contexts, you might find a useful starting point:

http://vb.mvps.org/samples/CustomBlt
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top