Welcome to LEAD Support Forum Login | Register | Faq  

    LEAD Support Forum
  Resource to find answers and post technical questions about LEAD products.
Search    
   

Re: OutOfMemory error : AnnProtractorObject
Started by Neo.Ko at 04-05-2008 2:00. Topic has 8 replies.

Print Search « Previous Thread Next Thread »
  04-05-2008, 2:00
Neo.Ko is not online. Last active: 12/15/2008 1:32:57 AM Neo.Ko

Top 50 Posts
Joined on 01-25-2008
Posts 45
OutOfMemory error : AnnProtractorObject
Reply Quote

Hello.

I use
VB.Net 2005.
Leadtools V15
 : leadtools.dll 15.0.0.36
 : Leadtools.Annotations.dll 15.0.0.14


I create annprotractorobj like below
'-----------------
Public Function AnnObj_Angle() As AnnProtractorObject
            Dim AnnObj As New AnnProtractorObject
            AnnObj.Pen = ANN_DefaultPEN
            AnnObj.MeasurementUnit = AnnUnit.SmartEnglish
            AnnObj.AngularUnit = AnnAngularUnit.Degree
            AnnObj.Acute = True
            AnnObj.Font = ANN_DefaultFont
            AnnObj.ArcRadius = New AnnLength(0.5F, AnnUnit.Point)
            AnnObj.AnglePrecision = 0
            Return AnnObj
        End Function

ANN_DefaultPEN = New AnnPen(gAnnLineColor, New AnnLength(gAnnLineThick, AnnUnit.Pixel))
ANN_DefaultFont = New AnnFont(gAnnLineFontName, New AnnLength(gAnnLineFontSize), FontStyle.Bold)
'-----------------
I set fontname = "Arial", fontsize = 16
When i set gAnnLineThick = 5  , OutOfException Error occured in system.drawing.dll

'---------- related code
Private Sub MainView_PostImagePaint(ByVal sender As Object, ByVal e As PaintEventArgs)    
            Dim Imgcls As ClsImage
            Imgcls = gStudyList.CurStudy.CurImage
            If Not Imgcls.AnnBox Is Nothing Then
                Imgcls.AnnBox.Draw(e.Graphics)
            End If
end sub
'' This code is about  PostImagePaint Event of RasterImageViewer
'' AnnBox = AnnContainer

I tried to set some value for AnnLength
if AnnLength value is smaller than 3, error not occur
but if it is bigger than 3, error occur

if you can not see first time, draw it several times (5~6 times)  then you can see it.


please, inform me the solution.

thank you

 


   Report 
  04-05-2008, 2:10
Neo.Ko is not online. Last active: 12/15/2008 1:32:57 AM Neo.Ko

Top 50 Posts
Joined on 01-25-2008
Posts 45
Re: OutOfMemory error : AnnProtractorObject
Reply Quote

Additionally.

I load 24bpp image and shift 16bit allocated , 12bit stored
Image size was 1000 * 1000

if image size is smaller, the error is occur more easily


   Report 
  04-07-2008, 3:27
Adnan Ismail is not online. Last active: 1/6/2009 4:12:02 PM Adnan Ismail



Top 10 Posts
Joined on 07-31-2006
Posts 1,367
Re: OutOfMemory error : AnnProtractorObject
Reply Quote
Can you please download the latest LEADTOOLS v15 setup from our site and check if this issue can be reproduced using the latest toolkit DLLs? If it is still active, please put your code in a small test project (not your full application) and send it to me in a ZIP or RAR file with a sample image that shows the problem.
Adnan Ismail
LEADTOOLS Technical Support

   Report 
  04-08-2008, 2:47
Neo.Ko is not online. Last active: 12/15/2008 1:32:57 AM Neo.Ko

Top 50 Posts
Joined on 01-25-2008
Posts 45
Re: OutOfMemory error : AnnProtractorObject
Reply Quote

I download the latest Leadtools v15 and setup it.

I test this issue on the VBAnnotationDemo

I changed code like below

//-----------------------------------------------

Private Sub _menuItemAnnotationsCurrentObject_Click(...)
...
            ElseIf sender Is _menuItemAnnotationsCurrentObjectLine Then
            objectTemplate = New AnnProtractorObject
            Dim obj As AnnProtractorObject
            obj = CType(objectTemplate, AnnProtractorObject)

            obj.MeasurementUnit = AnnUnit.SmartEnglish
            obj.AngularUnit = AnnAngularUnit.Degree
            obj.Acute = True
            obj.Font = New AnnFont("Arial", New AnnLength(43), FontStyle.Bold)
            obj.Pen = New AnnPen(Color.Red, New AnnLength(5, AnnUnit.Pixel))
            obj.ArcRadius = New AnnLength(0.5F, AnnUnit.Point)
            obj.AnglePrecision = 0
...

 If Not objectTemplate Is Nothing Then
            If objectTemplate.SupportsPen AndAlso (Not TypeOf objectTemplate Is AnnProtractorObject) Then
                objectTemplate.Pen = _currentPen
            End If
         If objectTemplate.SupportsBrush Then
...

end sub


Private Function CreateDrawDesigner(...)
...
ElseIf TypeOf annObject Is AnnProtractorObject Then
            drawDesigner = New AnnProtractorDrawDesigner
...
end function

//---------------------------------------------------

Select line icon and draw it. but same problems occur

please tell me what is problem

ps. I wil send you source image by e-mail


   Report 
  04-08-2008, 5:16
Neo.Ko is not online. Last active: 12/15/2008 1:32:57 AM Neo.Ko

Top 50 Posts
Joined on 01-25-2008
Posts 45
Re: OutOfMemory error : AnnProtractorObject
Reply Quote

I send e-mail to support@leadtools.com

Subject is "OutOfMemory error : AnnProtractorObject"

It include link of this post and Zipped sample image

 

thank you


   Report 
  04-09-2008, 1:09
Adnan Ismail is not online. Last active: 1/6/2009 4:12:02 PM Adnan Ismail



Top 10 Posts
Joined on 07-31-2006
Posts 1,367
Re: OutOfMemory error : AnnProtractorObject
Reply Quote
I have modified the VBAnnotation demo as you suggested in the forum and test
the issue using the file you sent me. However, I am not able to see the
problem, I have tried to draw the lines more than 10 times. Is there a special
steps I need to follow?


Adnan Ismail
LEADTOOLS Technical Support

   Report 
  04-09-2008, 20:53
Neo.Ko is not online. Last active: 12/15/2008 1:32:57 AM Neo.Ko

Top 50 Posts
Joined on 01-25-2008
Posts 45
Re: OutOfMemory error : AnnProtractorObject
Reply Quote


I will send "VBAnnotationDemo" to you and attach image file captured error screen.

The error occur in this code
//---------------
Private Sub _viewer_PostImagePaint(ByVal sender As Object, ByVal e As System.Windows.Forms.PaintEventArgs)
        If Not _container Is Nothing Then
            _container.Draw(e.Graphics)
        End If
End Sub
//---------------

error message is "OutOfMemoryException"

 


   Report 
  04-10-2008, 11:29
Adnan Ismail is not online. Last active: 1/6/2009 4:12:02 PM Adnan Ismail



Top 10 Posts
Joined on 07-31-2006
Posts 1,367
Re: OutOfMemory error : AnnProtractorObject
Reply Quote

I was able to reproduce the problem using the modified example you sent me. I reported this issue to our engineers for further investigation in incident number 6875AMN. Please keep this number for future reference.
Adnan Ismail
LEADTOOLS Technical Support

   Report 
  07-28-2008, 8:04
Adnan Ismail is not online. Last active: 1/6/2009 4:12:02 PM Adnan Ismail



Top 10 Posts
Joined on 07-31-2006
Posts 1,367
Re: OutOfMemory error : AnnProtractorObject
Reply Quote
Our engineers marked incident 6875AMN fixed. The following are their comments on this incident:
This is a problem with graphics.DrawPath when the Arc radius is larger than the Pen width.
Our engineers have added a work-around inside the code. If you want to obtain it, please download the latest LEADTOOLS v15 patches.
If you don't wish to update your DLLs now, you could avoid the problem if you pass a radius greater than the pen size.
To get the latest patches, please send  your LEADTOOLS toolkit serial number to support@leadtools.com and mention this post.
Adnan Ismail
LEADTOOLS Technical Support

   Report 
Post
LEAD Support Fo... » Developer » Annotations » Re: OutOfMemory error : AnnProtractorObject

Powered by Community Server, by Telligent Systems