Default annotation size (stamp/text)

Questions, comments and suggestions concerning VintaSoft Imaging .NET SDK.

Moderator: Alex

Post Reply
DanielLW
Posts: 22
Joined: Tue Sep 01, 2015 2:42 pm

Default annotation size (stamp/text)

Post by DanielLW » Tue Oct 13, 2015 5:04 pm

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

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

Re: Default annotation size (stamp/text)

Post by Alex » Tue Oct 13, 2015 5:57 pm

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

DanielLW
Posts: 22
Joined: Tue Sep 01, 2015 2:42 pm

Re: Default annotation size (stamp/text)

Post by DanielLW » Wed Oct 14, 2015 3:27 pm

This works, thank you!

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests