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 : Saturday, April 7, 2007 1:42:08 AM(UTC)

Amit  
Amit

Groups: Registered
Posts: 101


Hi LEAD Support

I am using LEAD Tools 14 with Visual Basic 6

I want to create my own custom annotations.  I found one example in LEAD Demos "LEAD Tools Custom Annotation Example".  This demo is in C++.  As I am not much familier with C++, I am unable to understood the way to create it in VB6.  I also read the LEAD Tools help regarding this.  But, that was also not much helpful for me as the examples in Help are also in C++.

The custom annotations created in the example stated above "AP Spine Rough" and "Forearm Rough" are one I want to create in Visual Basic 6.

Can you please send me any sample code that creates above two tools ?

Waiting for your reply.

 

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 : Sunday, April 8, 2007 11:44:52 PM(UTC)
Maen Hasan

Groups: Registered, Tech Support
Posts: 1,326

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

Hello,

Please read the following sample code in the LEADTOOLS Main COM object Help file:
- AnnMouseDown example for Visual Basic.

Please let me know if this helps.

Thanks,
Maen Badwan
LEADTOOLS Technical Support
 
#3 Posted : Tuesday, April 17, 2007 8:56:28 PM(UTC)

Amit  
Amit

Groups: Registered
Posts: 101


Hi support,

As per your reply I check the MouseDown event for creating custom annotation
and changed as per my requirements, but it is not working as like the custom annotation created in c++.

I am giving here sample code back to you and some of my requirements.

Design of my annotation looks like:

                     (cx1,cy1) 
   (x1,y1)________________(x2,y2) - Line1 (x1,y1)-(x2,y2)
                              |
                              |
                              |
                              |   - Line3 (cx1,cy1)-(cx2,cy2)
                              |
                              |
                              |

   (a1,b1)________|______(a2,b2) - Line2 (a1,b1)-(a2,b2)
                              (cx2,cy2) 

Requirements :-
- Whenever I move any one line, whole custom annotation(group of all three lines) should move to other location.
- Line1 and Line2 could be moved horizontally or vertically from anyone points.
- Line3 shall be moved with points on there respective lines only(if annotation is horizontal then horizontally or if annotation is vertical then vertically).

Waiting for your reply.

File Attachment(s):
CustomAnnotation.zip (6kb) downloaded 34 time(s).
 
#4 Posted : Saturday, April 21, 2007 10:53:20 PM(UTC)
Maen Hasan

Groups: Registered, Tech Support
Posts: 1,326

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

Hello,

If you want to handle the line1 and line2 annotations in the custom annotation object, there is no need to group the annotation lines. You need to try handling them individually.

Thanks,
Maen Badwan
LEADTOOLS Technical Support
 
#5 Posted : Sunday, April 22, 2007 7:45:46 PM(UTC)

Amit  
Amit

Groups: Registered
Posts: 101


Hi Support,

Would you plesae provide me some sample code in Visual Basic 6 ?

I have attached sample application in previous post.  Would you please modify the same and mail me back here ?

That will help me understand the concept better.

Waiting for reply

 
#6 Posted : Wednesday, April 25, 2007 12:02:06 AM(UTC)
Maen Hasan

Groups: Registered, Tech Support
Posts: 1,326

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

Amit,

I investigated more about this issue and found something that might help.
Please change your code as follows and retry using the custom annotation object:
+---------------------------------+
Private Sub RasterAnn_OnAnnMouseDown(ByVal Button As Integer, ByVal Shift As Integer, ByVal x As Long, ByVal y As Long)
'Maen code
If hLine1 <> 0 Then
   Dim nHit
   nHit = RasterAnn.AnnHitTest(RasterAnn.AnnContainer, x, y)
   If nHit = 2 Then 'a handle
      RasterAnn.AnnSetSelected hLine1, False, False
      RasterAnn.AnnSetSelected hLine2, False, False
      RasterAnn.AnnSetSelected hLine3, False, False
      RasterAnn.AnnSetSelected RasterAnn.AnnHitTestObject, True, False
   Else
      RasterAnn.AnnSetSelected hLine1, True, False
      RasterAnn.AnnSetSelected hLine2, True, False
      RasterAnn.AnnSetSelected hLine3, True, False
   End If
End If
    ' end Maen  code
    x0 = x
    y0 = y
If selfeature = "Custom" Then
    Select Case RasterAnn.AnnTool
        Case ANN_TOOL_USER_FIRST
            ' create the objects
            RasterAnn.AnnSetSelected RasterAnn.AnnContainer, False, True
            'Add an undo node to undo the creation of these objects.
            RasterAnn.AnnAddUndoNode
            
            RasterAnn.AnnCreate ANN_OBJECT_LINE, True, True
            hLine1 = RasterAnn.AnnObject
            
            RasterAnn.AnnCreate ANN_OBJECT_LINE, True, True
            hLine2 = RasterAnn.AnnObject
            
            RasterAnn.AnnCreate ANN_OBJECT_LINE, True, True
            hLine3 = RasterAnn.AnnObject
            
            oldx = x
            oldy = y
            
            ' set the automation defaults to the objects newly created
            RasterAnn.AnnSetAutoDefaults hLine1, 0
            RasterAnn.AnnSetAutoDefaults hLine2, 0
            RasterAnn.AnnSetAutoDefaults hLine3, 0
            ' start defining them from the x, y coordinate
            RasterAnn.AnnDefine hLine1, x, y, ANN_DEFINE_BEGINSET
            RasterAnn.AnnDefine hLine2, x, y + 50, ANN_DEFINE_BEGINSET
            RasterAnn.AnnDefine hLine3, x, y, ANN_DEFINE_BEGINSET
    End Select
End If
End Sub
...
Private Sub RasterAnn_OnAnnMouseUp(ByVal Button As Integer, ByVal Shift As Integer, ByVal x As Long, ByVal y As Long)
If selfeature = "Custom" Then
    Select Case RasterAnn.AnnTool
        Case ANN_TOOL_USER_FIRST
            RasterAnn.AnnDefine hLine1, x, y, ANN_DEFINE_END
            RasterAnn.AnnDefine hLine2, x, y + 50, ANN_DEFINE_END
            
            RasterAnn.AnnDefine hLine3, (oldx + x) / 2, oldy, ANN_DEFINE_BEGINSET
            RasterAnn.AnnDefine hLine3, (oldx + x) / 2, y + 50, ANN_DEFINE_END
            
            RasterAnn.AnnSetSelected hLine1, True, False
            RasterAnn.AnnSetSelected hLine2, True, False
            RasterAnn.AnnSetSelected hLine3, True, False
'Maen            RasterAnn.AnnGroup RasterAnn.AnnContainer, ANN_FLAG_RECURSE + ANN_FLAG_SELECTED, ""
'Maen            hLine3 = 0
'Maen            hLine2 = 0
'Maen            hLine1 = 0
        Case ANN_TOOL_RECT
            AdjustMousePos Shift, x, y
    End Select
    selfeature = ""
End If
    RasterAnn.AnnTool = ANN_TOOL_SELECT
End Sub
...
+---------------------------------+

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.104 seconds.