Last post Dec 20, 2014 06:08 AM by anas
Dec 20, 2014 03:20 AM|Harrison.Scott|LINK
I have the below code which is working as i expected (I think)
Can someone tell me how or what I'm suppose to return back, I understand its a byte of the image, but how do you get the new image after the orientation has been changed?
public byte ChangeImageOreintation(byte images)
var ms = new MemoryStream(images);
var originalImage = Image.FromStream(ms);
int rotationValue = originalImage.GetPropertyItem(0x0112).Value;
case 1: // landscape, do nothing
case 8: // rotated 90 right
case 3: // bottoms up
case 6: // rotated 90 left
Dec 20, 2014 06:08 AM|anas|LINK
You need to return the "originalImage" instance here. but this instance of type Image, so you need to change the method return type from byte to Image.
If you still need to return it in byte format, you need to convert this instance to byte .
You can take a look at this link on how to convert between those types.