Size of an StampAnnotation

Questions, comments and suggestions concerning VintaSoft Annotation .NET Plug-in.

Moderator: Alex

Post Reply
MichaelHerrmanns
Posts: 17
Joined: Mon Jan 03, 2011 2:45 pm

Size of an StampAnnotation

Post by MichaelHerrmanns » Tue Dec 20, 2011 3:50 pm

Hello,

how can I create a Stampannotation with an userdefinded size on mouse click.
I try with this code:

Code: Select all

Dim ann As New StampAnnotation()
ann.Text = "Rubber stamp"
ann.ZOrder = _zOrder
ann.Size = New SizeF(450, 800)
_zOrder += 1
Try
    annotationViewer1.BuildAnnotation(ann)
Catch ex As InvalidOperationException
    MessageBox.Show(ex.Message, "Building annotation")
End Try
The stamp has only a size of (1,1) on release the mousebutton.
Have anyone a solution for this problem?

regards

Michael

Alex
Site Admin
Posts: 1461
Joined: Thu Jul 10, 2008 2:21 pm

Re: Size of an Stampannotation

Post by Alex » Thu Dec 22, 2011 3:01 pm

Hello Michael,

Now you should add annotation to the annotation collection of image and later change size of annotation if necessary.
Here is a snippet of code:

Code: Select all

Dim ann As New StampAnnotation()
ann.Text = "Rubber stamp"
ann.ZOrder = _zOrder
ann.Size = New SizeF(450, 800)
_zOrder += 1
Try
   annotationViewer1.Annotations(0).Add(ann)
Catch ex As InvalidOperationException
   MessageBox.Show(ex.Message, "Building annotation")
End Try
What is your goal? Do you need to specify minimal size of annotation before building? Could you explain me, step by step, how do you imagine this?

Best regards, Alexander

MichaelHerrmanns
Posts: 17
Joined: Mon Jan 03, 2011 2:45 pm

Re: Size of an Stampannotation

Post by MichaelHerrmanns » Tue Jan 03, 2012 9:52 am

Hello Alex,

thank you for your reply. I am late, butI was on my christmas vacation.
#Do you need to specify minimal size of annotation before building?
Yes thats my goal. The User create with an stamp a stampannotation and this should be in
default size. After that the user can change the size of this stamp.

I hope itis clear what I want to do.
Best Regards

Michael

MichaelHerrmanns
Posts: 17
Joined: Mon Jan 03, 2011 2:45 pm

Re: Size of an Stampannotation

Post by MichaelHerrmanns » Wed Jan 11, 2012 3:38 pm

Hi Alex,

I have one additional question.
If I you your code:

Code: Select all

annotationViewer1.Annotations(0).Add(ann)
only on the first page of my document can take the annotation.
How can I tell them to build the annotation on the selected page?

Best regards

Michael

Alex
Site Admin
Posts: 1461
Joined: Thu Jul 10, 2008 2:21 pm

Re: Size of an Stampannotation

Post by Alex » Thu Jan 12, 2012 4:53 pm

Hello Michael,

Here is a code snippet for VB.NET:

Code: Select all

Dim pageIndex As Integer = 0
annotationViewer1.Annotations(pageIndex).Add(ann)
and here is a code snippet for C#:

Code: Select all

int pageIndex = 0;
annotationViewer1.Annotations[pageIndex].Add(ann);
Best regards, Alexander

MichaelHerrmanns
Posts: 17
Joined: Mon Jan 03, 2011 2:45 pm

Re: Size of an Stampannotation

Post by MichaelHerrmanns » Fri Jan 13, 2012 11:25 am

Hello Alex,

thank you for your tip.
It works now.

Best regards

Michael

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest