posted 18 years ago
Well I don't really understand ARGB yet, but with RGB, if you specify 0 then thats just black, but in ARGB it comes up as transparent.
If you run my code above, you will have to create an instance of class first, you will see the part of the icon not drawn into shows up as black on the button.
If you then use ARGB instead, you'll see it works fine.
Basically, for my chess application, I have decided to store the images in the classes by saving the pixel data, then building the image from that.
Since the pieces aren't square, eg knight, when you move them on top of another picture, you will want to see the background behind the knight, as you drag it.
But the knights' pixels are stored within a 40 by 40 rectangle, hence a 1600 element array of colors.
If I used RGB colors, then whatever colors I used for the area surrounding knight, I wud still get the whole 40 by 40 square moving with it, whenever knight is dragged.
But by saving the points in the square (exterior to the knight) as 0 using ARGB makes them transparent, and the background shows through.
So thats where I got the idea to change the code in first message to ARGB instead of RGB to get it to work.