Page 1 of 1

Default annotation size (stamp/text)

Posted: Tue Oct 13, 2015 5:04 pm
by DanielLW
Hello,

when adding text or stamp annotations in the annotation viewer, the user can create them by dragging a "size box", or click once to get a annotation with a default size. The stamp annotation for example seems to have the fixed default size of 288x96 pixels (regardless of the underlying image), when adding it by clicking once.
Is it possible to change this default size somehow? I've tried to set the Size property of AnnotationData and AnnotationView objects, but they are obviously ignored for this case.

And what exactly does the "AutoSize"-property do? Even if set to false, the stamp annotation automatically resizes the content if the size is changed.

Thank you and best regards
Daniel

Re: Default annotation size (stamp/text)

Posted: Tue Oct 13, 2015 5:57 pm
by Alex
Hello Daniel,

For changing the default size of Stamp annotation you need:
  • Get the builder of Stamp annotation view
  • Convert reference to the Stamp annotation view builder to a refernce to the builder of rectangle annotation
  • Set the annotation default size in the the builder of rectangle annotation
Here is a code snippet that shows how to change the default size of Stamp annotation:

Code: Select all

if (annotationView.Builder is RectangularAnnotationBuilder)
  ((RectangularAnnotationBuilder)annotationView.Builder).DefaultSize = new SizeF(200, 300);
Best regards, Alexander

Re: Default annotation size (stamp/text)

Posted: Wed Oct 14, 2015 3:27 pm
by DanielLW
This works, thank you!