The MASM Forum Archive 2004 to 2012

General Forums => The Campus => Topic started by: RHL on April 02, 2012, 04:32:09 AM

Title: problems for understand mask for Bitmap
Post by: RHL on April 02, 2012, 04:32:09 AM
Hello guys, well I'm try make a mask for a bitmap
but I not understand :(
I found these tutorials:

http://www.relisoft.com/win32/bitmap.html
http://www.winprog.org/tutorial/transparency.html

but none show me as do it step to step , someone know do or know a good tutorial? thanks MASM forum!
Title: Re: problems for understand mask for Bitmap
Post by: MichaelW on April 02, 2012, 07:48:12 AM
This is not exactly what you seem to be asking for, but there is an example  here (http://www.masm32.com/board/index.php?topic=10421.0) that uses MaskBlt and a mask that I created in Paint to make the corners of playing-card bitmaps transparent. It should be possible to automate the creation of the mask, but for the simple example it was easier to make one in Paint.

Title: Re: problems for understand mask for Bitmap
Post by: zemtex on April 02, 2012, 09:54:09 AM
You can write your own routine to do it quite easily using dib sections. Is this what you mean?
Title: Re: problems for understand mask for Bitmap
Post by: RHL on April 02, 2012, 05:53:09 PM
Quote from: zemtex on April 02, 2012, 09:54:09 AM
You can write your own routine to do it quite easily using dib sections. Is this what you mean?

ur zip is detected as virus   :eek
Title: Re: problems for understand mask for Bitmap
Post by: dedndave on April 02, 2012, 05:57:12 PM
and no source code   :'(
although, it was pretty easy to disassemble

it passes by MBAM
Title: Re: problems for understand mask for Bitmap
Post by: RHL on April 02, 2012, 05:59:42 PM
MichaelW: thanks u, I will check




in general I want insert a bitmap for a button control but the bitmap has a white background color and I want delete it,

@dedndave:
:) ok ok sorry for my drama lol, what is yah? xd
Title: Re: problems for understand mask for Bitmap
Post by: dedndave on April 02, 2012, 06:03:13 PM
yah = yes = si   :bg
Title: Re: problems for understand mask for Bitmap
Post by: dedndave on April 02, 2012, 06:10:14 PM
as for the image...
there are many ways to do it
but i would make the image a transparency

i want to add a couple notes....

you can set the background color when you register a window class
for the 3 child windows (RHLWin), i used 0 for the hbrBackground member of the WNDCLASSEX structure
that means that no background is drawn
i did that because i knew i was going to fill the entire window with an image

also, when you use a bitmap in a static control, the static control sizes itself to the image
so, you only need worry about the x and y position - the size will take care of itself