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 : Tuesday, August 12, 2008 9:14:30 AM(UTC)
JoeBussell

Groups: Registered
Posts: 15


Greetings Listers,
   I am working with Lead Document Imaging 14.5 under Visual Basic 6.  I am attempting to follow the online examples for creating a polygon, but I am not getting the results that I expect.  The code I am using follows the following pattern:

Public Function DrawFourVertexPolygon( ByVal x1 As Double, ByVal y1 As Double, _
                                        ByVal x2 As Double, ByVal y2 As Double, _
                                        ByVal x3 As Double, ByVal y3 As Double, _
                                        ByVal x4 As Double, ByVal y4 As Double) As Long

    Dim hObjAn As Long

    LEAD1.AnnUserMode = ANNUSER_DESIGN

    hObjAn = LEAD1.AnnCreate(ANNOBJECT_POLYGON, True, True)
    LEAD1.AnnDefine hObjAn, x1, y1, ANNDEFINE_BEGINSET
    LEAD1.AnnDefine hObjAn, x2, y2, ANNDEFINE_APPEND
    LEAD1.AnnDefine hObjAn, x3, y3, ANNDEFINE_APPEND
    LEAD1.AnnDefine hObjAn, x4, y4, ANNDEFINE_END
    LEAD1.AnnUserMode = ANNUSER_RUN
    LEAD1.AnnSetForeColor hObjAn, RGB(20, 90, 20), False

    DrawFourVertexPolygon = hObjAn
End Function

I am only seeing three vertexes.  I tried various combinations of append to no good effect.  I browsed through the annotation examples, but these all depend on mouse clicks, and some assumptions appear to be made by Lead based on the tool mode that I do not understand.

I have already looked through the following posts:
http://support.leadtools.com/SupportPortal/cs/forums/22103/ShowPost.aspx
http://www.leadtools.com/Help/LEADTOOLS/v15/DH/TO/Leadtools.Topics~Leadtools.Topics.AnnPolygonObject.html
And I also did a search of http://support.leadtools...forums/13/ShowForum.aspx and did not see any examples of constructing polygon annotations programatically.  None of the 14 posts related to Polygon provide any insight into this problem.

I appreciate your time.
 

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 : Tuesday, August 12, 2008 9:56:49 AM(UTC)

GregR  
GregR

Groups: Registered, Tech Support, Administrators
Posts: 764


I have reproduced this problem and need to report it to our engineering department.  However, in order to do that I need you to send an email to support@leadtools.com including the following information:

1. The company you work for
2. The LEADTOOLS serial number(s) you own (if you are evaluating, just say so)
3. The name(s) of the developer(s) using the serial number
4. A link to this forum post

As a workaround, you can use the AnnSetPoints method like this:

Public Function DrawFourVertexPolygon2(ByVal x1 As Double, ByVal y1 As Double, _
                                        ByVal x2 As Double, ByVal y2 As Double, _
                                        ByVal x3 As Double, ByVal y3 As Double, _
                                        ByVal x4 As Double, ByVal y4 As Double) As Long

    Dim hObjAn As Long

    LEAD1.AnnUserMode = ANNUSERMODE_DESIGN

    Dim x(4) As Single
    Dim y(4) As Single
    x(1) = x1
    x(2) = x2
    x(3) = x3
    x(4) = x4
    y(1) = y1
    y(2) = y2
    y(3) = y3
    y(4) = y4

    hObjAn = LEAD1.AnnCreate(ANNOBJECT_POLYGON, True, True)
    LEAD1.AnnSetPoints hObjAn, x, y, 4
    LEAD1.AnnUserMode = ANNUSERMODE_RUN
    LEAD1.AnnSetForeColor hObjAn, RGB(20, 90, 20), False

    DrawFourVertexPolygon2 = hObjAn
End Function
 
#3 Posted : Wednesday, August 13, 2008 4:07:08 AM(UTC)

GregR  
GregR

Groups: Registered, Tech Support, Administrators
Posts: 764


I have reproduced this problem and have reported it with the incident number 7218IDT.  This incident will be reviewed and prioritized by our engineering department.  I will contact you when I get more information from our developers.

If you have any more questions, please let me know.
 
#4 Posted : Tuesday, June 9, 2009 8:44:47 AM(UTC)

GregR  
GregR

Groups: Registered, Tech Support, Administrators
Posts: 764


The developers have let me know that this is not a bug.  When using AnnDefine, the ANNDEFINE_END point must be the same as the last ANNDEFINE_APPEND point.

Therefore the correct way to create a four vertex polygon would be like this:


LEAD1.AnnDefine hObjAn, x1, y1, ANNDEFINE_BEGINSET
LEAD1.AnnDefine hObjAn, x2, y2, ANNDEFINE_APPEND
LEAD1.AnnDefine hObjAn, x3, y3, ANNDEFINE_APPEND
LEAD1.AnnDefine hObjAn, x4, y4, ANNDEFINE_APPEND
LEAD1.AnnDefine hObjAn, x4, y4, ANNDEFINE_END

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