Icon transparency... again!

  • Thread starter Thread starter Fabio Zanetta
  • Start date Start date
F

Fabio Zanetta

Damn!

Is it possible or not in CF to obtain a transparent background for icons?

Almost... can I convert a Control.GreateGraphics into a Bitmap?

Thanks
 
Yes you can have icons with transparent background. They must be 16*16 icons
though, no larger icons are supported.

Don't know about the other question...

/ P
 
Peter B ha scritto:
Yes you can have icons with transparent background. They must be 16*16 icons
though, no larger icons are supported.

And so why they are shown with a black background?

Thanks
 
Because it's not transparent? :-)

Also make sure you don't have a "multi-size icon", which hold information
for all different sizes. Use a special icon-viewer progam to erase any other
icon-resolutions than 16*16.

regards,

Peter
 
Peter B ha scritto:
Because it's not transparent? :-)

No, it's transparent.
Also make sure you don't have a "multi-size icon",

Yes, it's a single icon file loaded into a PictureBox.

Use a special icon-viewer progam to erase any other
icon-resolutions than 16*16.

Already done.
I tryied with 16*16*16 and 16*16*256 and always the picturebox has a
black background on PocketPC2003, on PocketPC2002 all Ok, on Win CE 4.2
picturebox have white background.

Thanks
 
The code I had to add was
Rectangle rectDest = new Rectangle(imageX, imageY, 100,100)
ImageAttributes imgatt = new ImageAttributes()
imgatt.SetColorKey(Color.LightGray, Color.LightGray) // This color should be set to whatever your bmp background color i
// if it is transparent change it a color
g.DrawImage(bmpNew, rectDest, 0, 0, 99,99, GraphicsUnit.Pixel, imgatt)
 
Back
Top