LEADTOOLS Support
Document
Document SDK Questions
Problem about Reloading rasterimageviewer with annotation
This topic and its replies were posted before the current version of LEADTOOLS was released and may no longer be applicable.
#1
Posted
:
Tuesday, March 21, 2006 6:45:49 PM(UTC)
Groups: Registered
Posts: 9
Leadtools 14.5 Annotation Problem:
Question:
i am writing a form (say form1) with a rasterimageviewer for viewing the image with annotation by using vb.net. In this form, another form (say form2) will be shown when a "EDIT" button on Form1 is clicked. In this form (form2), user can edit the image by using annotation tools. When form2 is closed, the image in form1 will be reloaded again by using codes.load() and AnnCodecs.Load() method. However, the image will be shown with the previous and the new edited annotation.
>> It means that both original and new added annotated objects will be shown in the rasterimageviwer of form1 after reload the image.
i try to use RasterImageViewer.Invalidate(myContainer.InvalidRectangle) to reprint the anncontainer of the rasterimageviewer. However, the problem still present. Please advice. Thanks.
#2
Posted
:
Thursday, March 23, 2006 6:06:49 AM(UTC)
Groups: Registered, Tech Support
Posts: 1,326
Was thanked: 1 time(s) in 1 post(s)
Hello,
You may try to solve this by defining a global temp AnnContainer object to hold the annotations that comes from form2 and add them to the container in Form1 as follows:
- When close Form2, save the form2Anncontainr in the temp AnnContainer object:
+-------------------------------+
Private Sub Form2_Closed (ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Closed
AnnTempCont = AutomationAnn2.Container
End Sub
+-------------------------------+
- Then, add the objects from the temp AnnContainer to the objects in the form1Anncontainr:
+-------------------------------+
For i = 0 To AnnTempCont.Objects.Count - 1
AutomationAnn.Container.Objects.Add(AnnCont.Objects(i))
Next
+-------------------------------+
In this way, there is no need to use the AnnCodecs.Load method to load the new Annotations.
Please try the above instructions and let me know ho it goes.
Thanks,
Maen Badwan
LEADTOOLS Technical Support
#3
Posted
:
Sunday, March 26, 2006 9:50:58 PM(UTC)
Groups: Registered
Posts: 9
Thanks.
The correct annotation had been retrieved by using the coding mentioned from your replied message with the following code. ( to remove the object from the automation container )
Dim i As Integer
If automation.Container.Objects.Count > 0 Then
For i = 0 To automation.Container.Objects.Count - 1
automation.Container.Objects.Remove(automation.Container.Objects(0))
Next
End If
#4
Posted
:
Tuesday, March 28, 2006 1:24:41 AM(UTC)
Groups: Registered, Tech Support
Posts: 1,326
Was thanked: 1 time(s) in 1 post(s)
Hello,
Does this mean that the problem is fixed now?
Do you still need further assistance?
Thanks,
Maen Badwan
LEADTOOLS Technical Support
#5
Posted
:
Tuesday, March 28, 2006 10:11:31 PM(UTC)
Groups: Registered
Posts: 9
yes . the problem is fixed. Thanks.
LEADTOOLS Support
Document
Document SDK Questions
Problem about Reloading rasterimageviewer with annotation
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.