Can I add context menus to annotations?

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

Moderator: Alex

Post Reply
iansml
Posts: 31
Joined: Thu Apr 23, 2009 1:57 pm

Can I add context menus to annotations?

Post by iansml » Thu Apr 23, 2009 2:10 pm

Hi,

Is it possible to add context menus to annotations? You can add them to the AnnotationViewer but the annotations don't offer you any obvious way to do this.

There are a number of things I would like to allow users to amend once they have added an annotation, such as: increase/decrease font size in a TextAnnotation, change background/border colour in a RectangleAnnotation etc. These would be specific to a single annotation instance (e.g. 1 TextAnnotation box out of 3 on the image), not all annotations of that type (e.g. all TextAnnotations on the image) - so a context menu would seem to me the most user-friendly way of doing this.

If I can't add context menus, would someone be able to provide me with a workaround to do what I want to do?

Thanks.

iansml
Posts: 31
Joined: Thu Apr 23, 2009 1:57 pm

Re: Can I add context menus to annotations?

Post by iansml » Thu Apr 23, 2009 2:29 pm

An update: I have been able to add a context menu to the TextAnnotation.TextBox, but this isn't exactly what I had wanted for this control. You only really realise that you want the font size to be increased or decreased once you see it rendered on the image. In order to get to the context menu you must first double click the annotation to get the textbox up and then right click to get the context menu - which doesn't seem very user-friendly to me. A better and more intuitive way of doing this would be to right click on the rendered annotation and get the context menu on this instead (rather than via the textbox).

I am still unable to add a context menu to any of the other annotations.

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

Re: Can I add context menus to annotations?

Post by Alex » Thu Apr 23, 2009 5:53 pm

Hello,

We will add ability to use context menu for annotation in 2-3 working days, I think this feature will be available on Tuesday. Thank you for your suggestion.

Best regards, Alexander

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

Re: Can I add context menus to annotations?

Post by Alex » Mon Apr 27, 2009 1:11 pm

Hello Ian,

Please download the latest version of VintaSoftImaging.NET Library from this link: http://www.vintasoft.com/download.html
This version allows to add context menu to annotation, you can see how to do this in Annotation demo.

Best regards, Alexander

iansml
Posts: 31
Joined: Thu Apr 23, 2009 1:57 pm

Re: Can I add context menus to annotations?

Post by iansml » Mon Apr 27, 2009 5:56 pm

Thanks Alex. Great turnaround time and the new code does exactly what I wanted. The only slightly weird result is that the text in the "text entry" popup box also gets larger in proportion with the size of the font in the "text display" box. This makes editing "enlarged" text much harder.

To reproduce:
  • 1. Add TextAnnotation control to an image
    2. Double click to enter a paragraph of text - font size of text as you type is easy to read
    3. Click away from "entry" control to view text annotation - text is very small (A4, best fit)
    4. Right click and increase font size (e.g. 10 times) - font size is larger and more easily readable (A4, best fit)
    5. Double click to edit text - font size is very large and difficult to amend
Is this as designed? If so, is there any way you could add another setting that keeps the "data entry" font size the same no matter what the "text display" font size is?

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

Re: Can I add context menus to annotations?

Post by Alex » Tue Apr 28, 2009 8:48 am

Hi Ian
is there any way you could add another setting that keeps the "data entry" font size the same no matter what the "text display" font size is?
Ok, we will add ability to use different fonts for preview and editing for TextAnnotation in 2-3 days.

Best regards, Alexander

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

Re: Can I add context menus to annotations?

Post by Alex » Thu Apr 30, 2009 9:15 am

Hi Ian
is there any way you could add another setting that keeps the "data entry" font size the same no matter what the "text display" font size is?
In version 2.2.1 TextAnnotation.TextBox.Font does not change automatically when TextAnnotation.Font is changed. You can change TextAnnotation.TextBox.Font manually when this is necessary.

Best regards, Alexander

iansml
Posts: 31
Joined: Thu Apr 23, 2009 1:57 pm

Re: Can I add context menus to annotations?

Post by iansml » Fri May 01, 2009 3:37 pm

Hi Alexander,

How do I get the parent annotation when a context menu item is clicked? I tried:

Code: Select all

Control control = menuItem.GetCurrentParent().Parent;
- but it returns null. Any ideas?

Thanks,

Ian

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

Re: Can I add context menus to annotations?

Post by Alex » Mon May 04, 2009 7:17 pm

Hi Ian,
How do I get the parent annotation when a context menu item is clicked?
You can get the parent annotation using the SelectedAnnotation property of the AnnotationViewer object.

We will add parent to ContextMenu in next version of library.

Best regards, Alexander

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest