C# Programming
06-17-2009, 02:22 PM
public new static object GetIPictureDispFromPicture(System.Drawing.Image image)
{
System.Drawing.ImageConverter converter2 = new System.Drawing.ImageConverter();
byte[] arraybyt2 = (byte[])converter2.ConvertTo(image, typeof(byte[]));
System.Drawing.Image imageToConvert = System.Windows.Forms.AxHost.GetPictureFromIPicture(System.Windows.Forms.AxHost.GetIPictureFromPictur e(image));
System.Drawing.ImageConverter converter = new System.Drawing.ImageConverter();
byte[] arraybyt = (byte[])converter.ConvertTo(imageToConvert, typeof(byte[]));
return System.Windows.Forms.AxHost.GetIPictureFromPicture(image);
}
The function receives a Image that needs to be converted to an ipicture. I found out that during change the image to a ipicture and back to image the size of the array of bytes are different. How come the size of the arraybyt1 and arraybyt2 are different. I'm creating a checksum of the array from bytes and therefor the checksum is also different?
{
System.Drawing.ImageConverter converter2 = new System.Drawing.ImageConverter();
byte[] arraybyt2 = (byte[])converter2.ConvertTo(image, typeof(byte[]));
System.Drawing.Image imageToConvert = System.Windows.Forms.AxHost.GetPictureFromIPicture(System.Windows.Forms.AxHost.GetIPictureFromPictur e(image));
System.Drawing.ImageConverter converter = new System.Drawing.ImageConverter();
byte[] arraybyt = (byte[])converter.ConvertTo(imageToConvert, typeof(byte[]));
return System.Windows.Forms.AxHost.GetIPictureFromPicture(image);
}
The function receives a Image that needs to be converted to an ipicture. I found out that during change the image to a ipicture and back to image the size of the array of bytes are different. How come the size of the arraybyt1 and arraybyt2 are different. I'm creating a checksum of the array from bytes and therefor the checksum is also different?