Hi, i encountered another problem.
It might be a little bit complex to describe the complete project, it is quite big. I hope the following description is sufficient.
I received an exception during a gdViewer.Refresh() call with the notice "division by 0". After some searching I noticed that pageWidth, pageHeight, verticalResolution and horizontalResolution had the values 0 or 0.0 but the currentPage is set to 1.
I'm a bit confused because these properties are read-only, so it can't be directly my fault ^^ Any ideas how these properties can become 0? Or can there be another known reason for a "division by 0" exception in a refresh call?
Thanks for the help,
Greetings
Exception in Refresh()-Method
Re: Exception in Refresh()-Method
Hi,
Unfortunately the information are not sufficient to reproduce the problem.
Please try to give us more information, the best should be a procedure to reproduce the issue...
Kind regards,
Loïc
Unfortunately the information are not sufficient to reproduce the problem.
Please try to give us more information, the best should be a procedure to reproduce the issue...
Kind regards,
Loïc
Re: Exception in Refresh()-Method
Hi.
The problem is solved. I can't give a code sample now (maybe later if someone wants it) because I would have to create a new test project. As I said, it is a quite big project. I use Visual Studio and used the properties/event tab to create the gdViewer_PageChanged Method. And I found out, that this method (after calling gdViewer.DisplayImageFromFile() ) seems to be called already before the loading process is finished. Inside the event method for PageChanged some methods are called that already handle all the actions that had to be done for the pageChanged event, also drawing regions on the document.
As i said, the properties for resolution and size are 0 during this process which I think caused the exception. The properties are only set after all event handling is done and the programm code jumps back to the point where DisplayImageFromFile() was called. After that line the size and resolution properties are not 0.
I solved the problem by removing the event method from the viewer and call it myself right behind the display method. Now it works fine. I hope I was able to eplain what happened. If not or if someone is interested a code example, I can try to build up a small project to reconstruct the error.
But thanks anyway
The problem is solved. I can't give a code sample now (maybe later if someone wants it) because I would have to create a new test project. As I said, it is a quite big project. I use Visual Studio and used the properties/event tab to create the gdViewer_PageChanged Method. And I found out, that this method (after calling gdViewer.DisplayImageFromFile() ) seems to be called already before the loading process is finished. Inside the event method for PageChanged some methods are called that already handle all the actions that had to be done for the pageChanged event, also drawing regions on the document.
As i said, the properties for resolution and size are 0 during this process which I think caused the exception. The properties are only set after all event handling is done and the programm code jumps back to the point where DisplayImageFromFile() was called. After that line the size and resolution properties are not 0.
I solved the problem by removing the event method from the viewer and call it myself right behind the display method. Now it works fine. I hope I was able to eplain what happened. If not or if someone is interested a code example, I can try to build up a small project to reconstruct the error.
But thanks anyway
Re: Exception in Refresh()-Method
Thank you very much for the return and your kind proposition.
I will try to reproduce the problem again. Maybe our current 7.3 version (to be released very soon) already solve the issue.
Cheers,
Loïc
I will try to reproduce the problem again. Maybe our current 7.3 version (to be released very soon) already solve the issue.
Cheers,
Loïc
Who is online
Users browsing this forum: No registered users and 0 guests