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 : Friday, May 16, 2008 12:35:49 PM(UTC)

rburrow  
rburrow

Groups: Registered
Posts: 15


Here is my code...
Im using VB.net and V15.0.0.0
Everything works as planned except the rubberstamps.
They work until I save the file then reopen it. Once reopened, all the annotations are selectable and editable except for the rubber stamps. They are there but will not let you select them. What am I doing wrong with the rubber stamps?

File Attachment(s):
Testann.zip (2,156kb) downloaded 19 time(s).
 

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, May 18, 2008 7:45:00 AM(UTC)

Adam Boulad  
Guest

Groups: Guests
Posts: 3,028

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

The annotations saved by
your code appear to be correct, and when loaded into our main Annotations demo,
the rubber stamps can be edited. Please check our demos and try to find out what's missing in your code.
 
#3 Posted : Monday, May 19, 2008 9:32:59 AM(UTC)

rburrow  
rburrow

Groups: Registered
Posts: 15


The annotations DO work in your demo, as does mine, as long as I use _annautomationmanager.createdefaultobjects. If you manually create the objects, the rubberstamp is not selectable.

I am creating it as such:

Dim RubberStampObj as new AnnAutomationObject
RubberStampObj.id=AnnAutomationManager.RubberStampObjectId
RubberStampObj.Name="RubberStamp"
Dim rubstamp as new AnnrubberStampObject
rubstamp.pen=new AnnPen(color.black,new annlength(1, annunit.display))
rubstamp.bruch=new AnnSolidBruch(color.yellow)
rubstamp.font=new Annfont("Arial", new AnnLength(48,AnnUnit.point),fontstyle.regular)
RubberStampObj.object=rubstamp
RubberStampObj.DrawDesignerType=gettype(AnnRectangleDrawDesigner)
RubberStampObj.EditDesignerType= gettype(AnnRectangleEditDesigner)
RubberStampObj.RunDesignerType=gettype(AnnRunDesigner)
btmp=new bitmap(16,16)
g=graphics.fromimage(btmp)
g.fillrectangle(bruchses.darkseagreen,0,0,16,16)
RubberStampObj.toolbarimage=btmp
RubberStampObj.toolbartooltiptext="Draw new rubber stamp object"
RubberStampObj.drawcursor=cursors.cross
RubberStampObj.contextmenu=AnnAutomationManger.CreateDefaultObjectContextMenu(RubberStamoObj.id)
RubberStampObj.UseRotateControlPoints=True
_annautomationmanager.objects.add(RubberStampObj)


Is this correct? If so, what else could be wrong. I actually added a sub to the main demo calling createmyobjects and commented out the _annautomationmanager.createdefaultobjects and the main demo worked the same as my demo, all items could be selected except for the rubber stamps.
 
#4 Posted : Tuesday, May 20, 2008 4:31:57 AM(UTC)

Adam Boulad  
Guest

Groups: Guests
Posts: 3,028

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


It
seems to me that using the RubberStamp object needs also the Stamp object to be created.


Adding the code for the Stamp object (you can use the toolbarimage = nothing for it) seems to be solving the issue.
 
#5 Posted : Tuesday, May 20, 2008 4:50:19 AM(UTC)

rburrow  
rburrow

Groups: Registered
Posts: 15


could you please give me an example of this?

Thank You.
 
#6 Posted : Wednesday, May 21, 2008 3:58:10 AM(UTC)

Adam Boulad  
Guest

Groups: Guests
Posts: 3,028

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


After being saved, the Rubber Stamp objects load as Stamp objects. This is probably why you need to create the stamp object when loading the saved files.
I used the same project that you attached above, and I added the following lines after theManager.Objects.Add(rubberstampObj)

'-------------------------------
Dim stampObj As New AnnAutomationObject
stampObj.Id = AnnAutomationManager.RubberStampObjectId
stampObj.Name = "Stamp"
Dim stam As New AnnStampObject
rubstam.Pen = New AnnPen(Color.Black, New AnnLength(1, AnnUnit.Display))
rubstam.Brush = New AnnSolidBrush(Color.Yellow)
rubstam.Font = New AnnFont("Arial", New AnnLength(48, AnnUnit.Point), FontStyle.Regular)
stampObj.Object = stam
stampObj.DrawDesignerType = GetType(AnnTextDrawDesigner)
stampObj.EditDesignerType = GetType(AnnRectangleEditDesigner)
stampObj.RunDesignerType = GetType(AnnRunDesigner)
g = Graphics.FromImage(btmp)
g.FillRectangle(Brushes.DarkMagenta, 0, 0, 16, 16)
stampObj.ToolBarImage = Nothing
stampObj.ToolBarToolTipText = "Draw new stamp object"
stampObj.DrawCursor = Cursors.Cross
stampObj.ContextMenu = AnnAutomationManager.CreateDefaultObjectContextMenu(stampObj.Id)
stampObj.UseRotateControlPoints = True
manager.Objects.Add(stampObj)
'-------------------------------

 
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-2020, Yet Another Forum.NET
This page was generated in 0.201 seconds.