Page 1 of 1

Size of an StampAnnotation

Posted: Tue Dec 20, 2011 3:50 pm
by MichaelHerrmanns
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

Re: Size of an Stampannotation

Posted: Thu Dec 22, 2011 3:01 pm
by Alex
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

Re: Size of an Stampannotation

Posted: Tue Jan 03, 2012 9:52 am
by MichaelHerrmanns
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

Re: Size of an Stampannotation

Posted: Wed Jan 11, 2012 3:38 pm
by MichaelHerrmanns
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

Re: Size of an Stampannotation

Posted: Thu Jan 12, 2012 4:53 pm
by Alex
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

Re: Size of an Stampannotation

Posted: Fri Jan 13, 2012 11:25 am
by MichaelHerrmanns
Hello Alex,

thank you for your tip.
It works now.

Best regards

Michael