Your Image Class sports a Save and a FromStream method, both of which can
work with a stream such as a MemoryStream. MemoryStream class has a
contructor overload that accepts a byte array, and it has a ToArray method
that gives you back a byte array. The header (Jpeg, gif, etc is simply part
of this array and you should not need to worry about it at all.
Hope that helps,
Peter
--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com
"piggy" wrote:
I am trying to convert an image to an byte array (tobytes() method) and from
byte array back to an image (frombytes() method). The problem i have here is
say the image size is 285 bytes but the total bytes is 635. I know it would
include the header but the header should be the same size regardless of the
image size. I tested the other image size of 407 bytes and the total bytes
array is 727. I am not sure what is wrong? your help would be appreciate
it.