Welcome Guest! To enable all features, please Login or Register.

Notification

Icon
Error

Options
View
Last Go to last post Unread Go to first unread post
#1 Posted : Thursday, May 18, 2006 1:36:48 AM(UTC)

marasma  
marasma

Groups: Registered
Posts: 51


I'm trying to use annotations, with VB2005 and FW2.0. To start my job I'm looking at your example VBAutomationDemo. One of the most important feature I need is to put on an image many annotations (also 500 annotations). The example work fine, and it demonstrate the functionality I need, but with many object the application goes slowly. If I try to select an annotation, only select, it respond after some seconds and if try to move the annotation all proceed slowly. The hardware performance is very high and doing tests I understand that the problem is not a performance problem. Can you help me,  is there some recursively event fired whenever I move or some property to disable some function not needed?

Thanks.

 

Try the latest version of LEADTOOLS for free for 60 days by downloading the evaluation: https://www.leadtools.com/downloads

Wanna join the discussion? Login to your LEADTOOLS Support accountor Register a new forum account.

#2 Posted : Monday, May 22, 2006 4:15:29 AM(UTC)
Maen Hasan

Groups: Registered, Tech Support
Posts: 1,326

Was thanked: 1 time(s) in 1 post(s)

Hello,

If you try the same issue on a small project that loads an image and creates 500 annotation object, do you notice the same problem?
Also, if you close the project after creating the annotation objects, do you notice any performance problems when using windows (the system goes slowly)?

If the problem persists, then please send me a small working project that only shows the problem so that I can check it on my machine.

Thanks,
Maen Badwan
LEADTOOLS Technical Support
 
#3 Posted : Monday, May 22, 2006 7:42:57 AM(UTC)

marasma  
marasma

Groups: Registered
Posts: 51


Hi Maen,

the problem is always visible, also if I restart the pc and I run immediatly the application, other application running on the pc are not affected by any performance problem. Even if the application with 500 annotation take over 600-700 MB of Ram, I've 2GB installed on the pc.
In the attached example I use the automation manager with toolbar and then I add 500 stamps manually. If you try to select one stamp and move it in the container you can see how slow it is. Try also with 50 stamps. you'll se the difference. In my application I don't need to use the automation manager and the toolbar, for me is just ok to add stamps or any other object manually like in the example attached. Do you think automation manager uses many resources and for thi is so slow?

Thanks!!!!!!!!

File Attachment(s):
WindowsApplication1.zip (529kb) downloaded 34 time(s).
 
#4 Posted : Wednesday, May 24, 2006 5:17:53 AM(UTC)
Maen Hasan

Groups: Registered, Tech Support
Posts: 1,326

Was thanked: 1 time(s) in 1 post(s)

Hello,

I checked the project and noticed the behavior when creating 500 stamp annotations. It needs 2 seconds to move one stamp object.
But I think this is not a problem with our toolkit. This needs a special optimization for the memory to handle this special case. LEADTOOLS Annotation features are designed for general purposes with thousands features (Creating, saving, deleting, loading, etc).

However, if you would like to explore the possibility of adding this feature as a custom job, see our Contract Development page at http://www.leadtools.com/devservices/

Thanks,
Maen Badwan
LEADTOOLS Technical Support
 
#5 Posted : Friday, May 26, 2006 1:30:33 AM(UTC)

marasma  
marasma

Groups: Registered
Posts: 51


Hi Maen,

I understand which is the problem! Every time I select  or I  move an annotation the method Draw of the annotation container is called for refresh the image, but in the draw method as you can see below there'a a loop that force the redraw of every annotation.




Public Overridable Sub Draw(ByVal g As Graphics)
      If Me.Visible Then
            Dim state1 As GraphicsState = g.Save
            Using region1 As Region = New Region(Me.BoundsPixels)
                  If (Not Me.Transform Is Nothing) Then
                        region1.Transform(Me.Transform)
                  End If
                  g.Clip = region1
            End Using
            If (Me._ignoreDrawObjectEvents <= 0) Then
                  Me.OnBeforeDrawingObjects(New AnnPaintEventArgs(g))
            End If
            Dim obj1 As AnnObject
            For Each obj1 In Me.Objects
                  obj1.Draw(g)
            Next
            If (Me._ignoreDrawObjectEvents <= 0) Then
                  Me.OnAfterDrawingObjects(New AnnPaintEventArgs(g))
            End If
            g.Restore(state1)
      End If
End Sub

This method is called in the PostTransformPaint event of them ImageViewer, and if I don't implement it the annotation are not redrawn! How can optimize this event? Can I Force the redraw only when I need and which is the best moment to do this?

Thanks!

 
#6 Posted : Wednesday, May 31, 2006 4:44:18 AM(UTC)
Maen Hasan

Groups: Registered, Tech Support
Posts: 1,326

Was thanked: 1 time(s) in 1 post(s)

Hello,

Did you check this using the same project that you posted before?
The main problem is that you are creating 500 annotation object on the same container (with images), which needs sufficient memory and special handling for the memory.
However, you may try to stop drawing all annotation objects and force drawing of the selected Annobject by calling the AnnObject.DrawObject Method.

Thanks,
Maen Badwan
LEADTOOLS Technical Support
 
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Powered by YAF.NET | YAF.NET © 2003-2024, Yet Another Forum.NET
This page was generated in 0.105 seconds.