Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Converting byte[] into an Image object
#7
KajitiSouls Wrote:That's going to be a problem. I assume ReadAllBytes will fix that?
Theres no difference between using Image.FromFile or Image.FromStream using bytes read by ReadAllBytes.
The Bitmap object has a very weird way to handle transparency... Instead of properly implementing alpha channeling in the controls\forms, Microsoft made the transparent pixels be changed to the background color of your form. This is internal only, though, and if you browse the pixels using GetPixel it will look like they really are transparent. It will also save the picture correctly to file. However, if you try writing the Bitmap object to the clipboard using Clipboard.SetImage, the image set will have it's transparent pixels replaced with the background color. Another way to see this bug is, if you take a textBox control, and place a pictureBox over it containing a transparent image the textBox will not be seen through the supposedly transparent image, because it was actually replaced with a bitmap containing your form's background color.
Reply


Messages In This Thread
Converting byte[] into an Image object - by Kortestanov - 2009-11-18, 09:11 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)