Author |
Topic  |
|
pkenderdine

Australia
14 Posts |
Posted - Sep 12 2013 : 04:31:58
|
I am using IEvolution2 4.3. My C# winforms application views Jpg images which are shown in IEViewer as ie24RGB format. Image are generally 300kb to 4mb in size. Images are loaded to auto fit the viewer. I've been using the product for a few years although I admit I know little of image processing. The tool has always been able to do what I needed it to.
Am I restricted to rotating the images by 90, 180 and 270 degrees? When ever I try to rotate by a different value nothing seems to happen. Is there some way I can rotate the images by a none 90 degree value.
Rotation is also slow, is there something I can do to speed it up.
My rotation code is: double rotate = Convert.ToDouble(numericUpDown1.Value); ieViewer1.Image.Rotate(rotate, true);
Kind Regards Phil
|
|
w2m
   
USA
1990 Posts |
Posted - Sep 12 2013 : 09:16:16
|
I do not use iEvolution, so I can only speak about ImageEn. With the ImageEn version, Rotate can be any double value from -360 to 360. The Rotate method rotates the current image of fangle angle (negative or positive degrees).
William Miller |
 |
|
pkenderdine

Australia
14 Posts |
Posted - Sep 12 2013 : 14:21:14
|
Thanks for the reply. It seems that images over a certain size are not rotating. Smaller ones 300kb - 600kb rotate but take a few seconds to complete. Seems to be giving up without any error message. Could it be a memory issue. I'm using the 32bit version and I notice that once I try to rotate a large image, the image stays the same and the memory doesn't seem to recover. Could there be some alternative options I can try such as reducing the image quality upon loading or rotating outside of IViewer. Are there some IOParams I should be setting?
Regards Phil |
 |
|
w2m
   
USA
1990 Posts |
Posted - Sep 13 2013 : 05:30:05
|
With Delphi there is no problem rotating 18mp images so I do not think size makes any difference, especially with 64-bit. You could try compiling as 64-bit if the software supports 64-bit.
William Miller |
 |
|
pkenderdine

Australia
14 Posts |
Posted - Sep 13 2013 : 06:12:28
|
Thanks again William. I do not think the size should be an issue either so I suspect there are additional problems.
I've done some further investigation and there is an exception being thrown from IEvolution2.dll:
ex {"External component has thrown an exception."} System.Exception {System.Runtime.InteropServices.SEHException} + [System.Runtime.InteropServices.SEHException] {"External component has thrown an exception."} System.Runtime.InteropServices.SEHException HResult -2147467259 int Message "External component has thrown an exception." Source "IEvolution2" string StackTrace " at HiComponents.IEvolution.TImageEnViewContainer.TImageEnViewProcRotate(UInt64 heview, Double fangle, Boolean antialiasprocedure, Int32 antialiasMode, IERGB backgroundColor)\r\n at HiComponents.IEvolution.IEImage.Rotate(Double angle, Boolean antialias)\r\n at ViewerTest.Form1.toolStripMenuItemRotate_Click(Object sender, EventArgs e) in d:\\Phil\\ViewerTest\\ViewerTest\\Form1.cs:line 329" string + TargetSite {Void TImageEnViewProcRotate(UInt64, Double, Boolean, Int32, HiComponents.IEvolution.IERGB)} System.Reflection.MethodBase {System.Reflection.RuntimeMethodInfo} WatsonBuckets null object + Static members
I have a project I can provide that will reproduce this error. I cannot upload the image that caused the error since it is large than 2mb. |
 |
|
w2m
   
USA
1990 Posts |
Posted - Sep 13 2013 : 08:00:51
|
Is your app 32-bit or 64-bit?
William Miller |
 |
|
pkenderdine

Australia
14 Posts |
Posted - Sep 13 2013 : 14:25:56
|
It is a 32bit app. Developed on Windows 7, Visual Studio 2012, Win Forms C# |
 |
|
w2m
   
USA
1990 Posts |
|
pkenderdine

Australia
14 Posts |
Posted - Sep 13 2013 : 16:13:35
|
Thanks William,
My client is using 32bit although I could port to 64bit to test but I cannot really see if this would be necessary. I'm sure someone with .Net IEvolution will respond soon (I hope). I still have a few days up my sleave before I panic and take an alternate route.
Thanks again William. |
 |
|
pkenderdine

Australia
14 Posts |
Posted - Sep 14 2013 : 18:20:37
|
I suspect something is not quite right in memory usage. I am unable to provide proof but suspicions. I watched the memory allocation of my application whilst debugging (Working Set in task manager). I realise there's a debugging overhead but not this large. I loaded the attached jpg into IEViewer component using the following function:
public void LoadImage(String fileName) { ImageFilename = fileName;
this.ieViewer2.AutoFit = true; IOParams ioParams = ieViewer2.Image.IOParams; ioParams.EnableAdjustOrientation = true; ieViewer2.Image.LoadImage(fileName);
// this will trigger the CheckedChange event and ultimately show the image in the main view if (fileName.EndsWith("TO.jpg", StringComparison.CurrentCultureIgnoreCase)) checkBox1.Checked = true;
string roiFile = fileName.Replace("TO.jpg", "TO.xml"); FileInfo fileInfo = new FileInfo(roiFile); if (fileInfo.Exists) { checkBox2.Visible = true; }
}
I set a break point at "ieViewer2.Image.LoadImage(fileName);" Before the memory is 56,588k and after is jumps to 153,376k. The actual image is 530k. I estimate there's about 100mb allocated for something. I need to load 6 of these images and the memory as expected does rise to about 695,012k. Not all images are like this one 530k but the largest would be about 4mb.
Hope this information helps.
BTW, the attached image does not really show anything but an incomprehensible object. Not all images are like this. This is just an example.
Regards Phil
{Image Removed} |
 |
|
pkenderdine

Australia
14 Posts |
Posted - Sep 14 2013 : 18:22:59
|
Sorry, the image looks completely black. But I can assure you it's not although you cannot see the entire image without scrolling right. Also I apologise for the formatting of my comment since it does not appear to be word wrapping so the text goes off the screen. |
 |
|
w2m
   
USA
1990 Posts |
|
pkenderdine

Australia
14 Posts |
Posted - Sep 14 2013 : 21:02:34
|
Yes, sorry about that. I will remove the image since it wasn't what I expected. I thought the image would be an attachment and not part of the response.
The image is {8192x4016 ie24RGB}, JPEGColorSpace.GrayScale
I was not aware of issues with 32bit memory but will check out the link. Tomorrow I will port to 64bit to see if this clear things up. This will not help me since I cannot ask the customer to upgrade all their computers to 64bit.
Once again, thanks for your input.
Regards Phil |
 |
|
pkenderdine

Australia
14 Posts |
Posted - Sep 15 2013 : 19:45:06
|
Based on the size of the image and I now think they are 24bit too, I can conclude that the size of 100mb memory is more likely that unlikely and that loading 6 of them is then going to stretch my system resources to the max. So this comes back to your theory of the 32bit memory problem although in my case I appear to be using it up which is my problem.
Is there are way to show thumbnail images which will take up less memory usage than showing an image full or scaled size? I currently show up to 6 thumbnails of which one can be selected and shown at a larger scale, but not full size since the window is not large enough.
|
 |
|
pkenderdine

Australia
14 Posts |
Posted - Sep 15 2013 : 20:10:45
|
How can I tell what the bpp are for my jpg. I now think I have 8bpp and IEViewer storing at 24bpp. Could this be correct? |
 |
|
pkenderdine

Australia
14 Posts |
Posted - Sep 15 2013 : 20:45:06
|
OK, sorry for all the posts but it has taken me this long to work things out. No excuses really but I now know a lot more than I did a few days ago. And of course there is mention of this in the class documentation.
Firstly I have solved my problem by the following magnificent settings: Image.NativePixelFormat = true; Image.LegacyBitmap = false; Image.LoadImage(filename);
Basically my images were getting converted to 24bpp so my memory usage was causing my application to stretch the available resources to the max. This on occasions caused IEvolution to raise an exception.
Special thanks to William for adding input and making me look at different things to solve my puzzle.
Regards Phil |
 |
|
|
Topic  |
|