Exception in Rotate Image
Posted: Tue May 19, 2009 11:35 pm
Alex,
I am trying to rotate an image by using the example in ImageViewer Demo Application. Here is a link to the demo application with my changes. This one throws the exception.
http://www.box.net/shared/sa7g3dpv29
My image is loaded in ImageViewer control and I call Rotate(90) on the FocusedImage, just as in ImageViewer Demo.
The only difference between my code and ImageViewer Demo is in
Line 77 of ImageViewerDemo.cs
In Demo it is
imageViewer1.Images.Add(openFileDialog1.FileName);
In demo the Image is loaded by File Path and
I need to load the image using Stream. So the line 77 looks like this
using (FileStream fs = File.Open(openFileDialog1.FileName, FileMode.Open))
{
imageViewer1.Images.Add(fs);
fs.Close();
}
It loads the image fine but when I right click and rotate it, throws this exception.
The exception is 'Rotate: Image is too big and cannot be processed."
The reason I need to load the image as a stream is because I do not want to lock the file. And the same image could be used/or be in use by other application.
Could you please let me know if there is a workaround for this or a fix can be provided for this.
Thanks,
Satrsi
I am trying to rotate an image by using the example in ImageViewer Demo Application. Here is a link to the demo application with my changes. This one throws the exception.
http://www.box.net/shared/sa7g3dpv29
My image is loaded in ImageViewer control and I call Rotate(90) on the FocusedImage, just as in ImageViewer Demo.
The only difference between my code and ImageViewer Demo is in
Line 77 of ImageViewerDemo.cs
In Demo it is
imageViewer1.Images.Add(openFileDialog1.FileName);
In demo the Image is loaded by File Path and
I need to load the image using Stream. So the line 77 looks like this
using (FileStream fs = File.Open(openFileDialog1.FileName, FileMode.Open))
{
imageViewer1.Images.Add(fs);
fs.Close();
}
It loads the image fine but when I right click and rotate it, throws this exception.
The exception is 'Rotate: Image is too big and cannot be processed."
The reason I need to load the image as a stream is because I do not want to lock the file. And the same image could be used/or be in use by other application.
Could you please let me know if there is a workaround for this or a fix can be provided for this.
Thanks,
Satrsi