Hello,
I'm still a new programer so try not to confuse me in your ansewer. But i need to know how to make the backround or a image transparent and then be able to move the image around.
Printable View
Hello,
I'm still a new programer so try not to confuse me in your ansewer. But i need to know how to make the backround or a image transparent and then be able to move the image around.
http://vbden.tripod.com/articles/invmask.htm
It's called BitBlt.
Don't get me wrong, but if you are a new programmer, graphics isn't the place to start. If you've done a couple of 'hello world' and input/output programs then you are ready, and you know the code in & out. Otherwise I don't suggest this area.
If according to this you are ready (and you think you are) then go for it!
My tutorial above shows you the basics of bitblt to 'backbuffers' and colour dipping.
I needed to do the same thing not too long ago... and I felt I WASN'T ready for the whole BitBlt thing :p. What I ended up doing is to use an ImageBox (instead of a PictureBox) so that I could use a GIF file as the source for the picture. Most image editors will allow you to create transparent backgrounds in a GIF. I've been told that GIFs can be slower in processing than BMPs but the game I wrote was fairly slow paced so it wasn't an issue. I also found that the performance was actually better when I switched from using PictureBoxes to ImageBoxes because ImageBoxes use less resources. Anyway... right or wrong, it works and that's what counts, right?
Oh, and by the way, moving it around, at least for me, was a simple matter of addjusting the Top and Left properties of the ImageBoxes.