Welcome to LEAD Support Forum Login | Register | Faq  

    LEAD Support Forum
  Resource to find answers and post technical questions about LEAD products.
Search    
   

Re: Loading only Wang supported annotations in the toolbar
Started by imsachin at 08-15-2007 9:18. Topic has 17 replies.

Print Search « Previous Thread Next Thread »
  08-15-2007, 9:18
imsachin is not online. Last active: 8/16/2007 7:56:46 PM imsachin

Not Ranked
Joined on 08-08-2007
Posts 4
Loading only Wang supported annotations in the toolbar
Reply Quote

Hi,  how do I display only the Wang supported annotations objects in the toolbar? I'd like to prevent users for selecting any other toolbar since we want to only support Wang annotations embedded in the TIFF file.

 

Tia!


   Report 
  08-16-2007, 6:38
Maen Hasan is not online. Last active: 11/17/2008 4:23:44 PM Maen Hasan



Top 10 Posts
Joined on 08-05-2004
Posts 1,799
Re: Loading only Wang supported annotations in the toolbar
Reply Quote
Hello,

LEADTOOLS SDK enables you to modify the toolbar and remove any button you don't want from it.
If you want more detail, please provide me with the following information:
What is the exact LEADTOOLS version (13, 14, 14.5, 15, etc.) that you use? Also, what is the exact LEADTOOLS programming interface (COM, OCX, API, .Net, C++ Class Library, etc.) that you use?

Thanks,
Maen Badwan
LEADTOOLS Technical Support
   Report 
  08-16-2007, 14:58
imsachin is not online. Last active: 8/16/2007 7:56:46 PM imsachin

Not Ranked
Joined on 08-08-2007
Posts 4
Re: Loading only Wang supported annotations in the toolbar
Reply Quote

I am using v15 of LeadTools in VB.net 2005.

Thanks!


   Report 
  08-20-2007, 5:40
Maen Hasan is not online. Last active: 11/17/2008 4:23:44 PM Maen Hasan



Top 10 Posts
Joined on 08-05-2004
Posts 1,799
Re: Loading only Wang supported annotations in the toolbar
Reply Quote
Hello,

The following code shows how to delete specific objects (RubberStamp and Encrypt objects) from the annotation toolbar:
+-----------------+
Public Class Form1
Private manager As AnnAutomationManager
Private codecs As RasterCodecs

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

RasterSupport.Unlock(RasterSupportType.Document, "Document Unlock key")

' create and set up the automation manager
...
manager = New AnnAutomationManager()
manager.CreateDefaultObjects()

Dim annobj As AnnAutomationObject

Dim i As Integer

For i = manager.Objects.Count - 1 To 0 Step -1

annobj = manager.Objects.Item(i)
If annobj.Id = AnnAutomationManager.RubberStampObjectId Or annobj.Id = AnnAutomationManager.EncryptObjectId Then
manager.Objects.Remove(annobj)
End If

Next

manager.CreateToolBar()
Controls.Add(manager.ToolBar)
...
End Sub
+-----------------+

Thanks,
Maen Badwan
LEADTOOLS Technical Support
   Report 
  08-20-2007, 9:45
imsachin is not online. Last active: 8/16/2007 7:56:46 PM imsachin

Not Ranked
Joined on 08-08-2007
Posts 4
Re: Loading only Wang supported annotations in the toolbar
Reply Quote
Thanks. I'll give this a shot today and will post how it goes.
   Report 
  08-20-2007, 13:42
imsachin is not online. Last active: 8/16/2007 7:56:46 PM imsachin

Not Ranked
Joined on 08-08-2007
Posts 4
Re: Loading only Wang supported annotations in the toolbar
Reply Quote

Works perfectly.

[Y] Thanks for your help!


   Report 
  09-01-2008, 23:02
roadman is not online. Last active: 9/26/2008 5:05:06 PM roadman

Top 25 Posts
Joined on 06-27-2007
Posts 95
Re: Loading only Wang supported annotations in the toolbar
Reply Quote

hi, I tried to do it in the same way in C#, however, the object cannot be removed. Did i miss sth?

            AnnAutomationManager automationManager = null;
            AnnAutomation automation = null;
            RasterCodecs codecs = null;
            AnnAutomationObject annAutomationObj = null;

            automationManager = new AnnAutomationManager();
            automationManager.RasterCodecs = codecs;
            automationManager.RedactionRealizePassword = String.Empty;
            automationManager.UseXPStyleToolBar = true; // enable 14.5 new XP style toolbar -- must be called CreateDefaultObjects();
            automationManager.CreateDefaultObjects();

            for (int idx = 0; idx < automationManager.Objects.Count ; idx++)
            {
                annAutomationObj = automationManager.Objects[idx];
                if  (   (annAutomationObj.Id == AnnAutomationManager.RulerObjectId) ||
                        (annAutomationObj.Id == AnnAutomationManager.PolyRulerObjectId) ||
                        (annAutomationObj.Id == AnnAutomationManager.ProtractorObjectId) ||
                        (annAutomationObj.Id == AnnAutomationManager.StampObjectId) ||
                        (annAutomationObj.Id == AnnAutomationManager.AudioObjectId) ||
                        (annAutomationObj.Id == AnnAutomationManager.ButtonObjectId) ||
                        (annAutomationObj.Id == AnnAutomationManager.CrossProductObjectId) ||
                        (annAutomationObj.Id == AnnAutomationManager.HotspotObjectId) ||
                        (annAutomationObj.Id == AnnAutomationManager.FreehandHotspotObjectId) ||
                        (annAutomationObj.Id == AnnAutomationManager.PointObjectId) ||
                        (annAutomationObj.Id == AnnAutomationManager.RubberStampObjectId)
                       
                    )
                {
                    automationManager.Objects.Remove(annAutomationObj);
                }
            }


   Report 
  09-02-2008, 8:03
Qasem Lubani is not online. Last active: 11/9/2008 3:40:25 PM Qasem Lubani



Top 10 Posts
Joined on 08-13-2006
Posts 1,135
Re: Loading only Wang supported annotations in the toolbar
Reply Quote

Did you get any error messages? Did you try to run the VB.NET code at your end? Did it work?
Qasem Al-Lubani
LEAD Technical Support
www.leadtools.com
   Report 
  09-02-2008, 10:31
roadman is not online. Last active: 9/26/2008 5:05:06 PM roadman

Top 25 Posts
Joined on 06-27-2007
Posts 95
Re: Loading only Wang supported annotations in the toolbar
Reply Quote
I didn't try it in VB.NET
For C#.NET, there is no error returns
   Report 
  09-03-2008, 6:18
roadman is not online. Last active: 9/26/2008 5:05:06 PM roadman

Top 25 Posts
Joined on 06-27-2007
Posts 95
Re: Loading only Wang supported annotations in the toolbar
Reply Quote
I have run it in debug mode and everything works fine (the program can enter the "if-statement") with no error returns. However...no effect was taken after all statements completed. Do anyone has idea?

Instead of generation toolbars by CreateDefaultObjects(), can we get a default objects (say line object) and then add the object into the created toolbars?


   Report 
  09-03-2008, 8:22
Qasem Lubani is not online. Last active: 11/9/2008 3:40:25 PM Qasem Lubani



Top 10 Posts
Joined on 08-13-2006
Posts 1,135
Re: Loading only Wang supported annotations in the toolbar
Reply Quote
I will take a look at the code and get back to you.
Qasem Al-Lubani
LEAD Technical Support
www.leadtools.com
   Report 
  09-04-2008, 8:22
Qasem Lubani is not online. Last active: 11/9/2008 3:40:25 PM Qasem Lubani



Top 10 Posts
Joined on 08-13-2006
Posts 1,135
Re: Loading only Wang supported annotations in the toolbar
Reply Quote
Try the following code:

 RasterSupport.Unlock(RasterSupportType.Document, "XXXXXXXX");
         AnnAutomationManager automationManager ;
        
         RasterCodecs codecs = null;
         AnnAutomationObject annAutomationObj;

         automationManager = new AnnAutomationManager();
         automationManager.RasterCodecs = codecs;
         automationManager.RedactionRealizePassword = String.Empty;
         automationManager.UseXPStyleToolBar = true; // enable 14.5 new XP style toolbar -- must be called CreateDefaultObjects();
         automationManager.CreateDefaultObjects();
         
         for (int idx = 0; idx < automationManager.Objects.Count; idx++)
         {
            annAutomationObj = automationManager.Objects[idx];
            if ((annAutomationObj.Id == AnnAutomationManager.RulerObjectId) ||
                    (annAutomationObj.Id == AnnAutomationManager.PolyRulerObjectId) ||
                    (annAutomationObj.Id == AnnAutomationManager.ProtractorObjectId) ||
                    (annAutomationObj.Id == AnnAutomationManager.StampObjectId) ||
                    (annAutomationObj.Id == AnnAutomationManager.AudioObjectId) ||
                    (annAutomationObj.Id == AnnAutomationManager.ButtonObjectId) ||
                    (annAutomationObj.Id == AnnAutomationManager.CrossProductObjectId) ||
                    (annAutomationObj.Id == AnnAutomationManager.HotspotObjectId) ||
                    (annAutomationObj.Id == AnnAutomationManager.FreehandHotspotObjectId) ||
                    (annAutomationObj.Id == AnnAutomationManager.PointObjectId) ||
                    (annAutomationObj.Id == AnnAutomationManager.RubberStampObjectId)

                )
            {
               automationManager.Objects.Remove(annAutomationObj);
               
            }
         }

         automationManager.CreateToolBar();
         Controls.Add(automationManager.ToolBar);
      }
   }
Qasem Al-Lubani
LEAD Technical Support
www.leadtools.com
   Report 
  09-04-2008, 9:34
roadman is not online. Last active: 9/26/2008 5:05:06 PM roadman

Top 25 Posts
Joined on 06-27-2007
Posts 95
Re: Loading only Wang supported annotations in the toolbar
Reply Quote
The result is the same.

Do you mean the i have to unlock RasterSupportType.Document? if yes, is the serial no. the same as the multimedia SDK and the Medical Suite?

   Report 
  09-04-2008, 12:17
jigar is not online. Last active: 11/19/2008 5:21:33 PM jigar



Top 10 Posts
Joined on 08-22-2007
Posts 447
Re: Loading only Wang supported annotations in the toolbar
Reply Quote
That code works for me too.  If you didn't unlock Document support then you would get an exception thrown, and you would not be able to create the toolbar or use any of the annotations at all.  Are you working with the EVAL version currently?  Create a new project and try that code in there.  If you are doing it in an existing project, there might be some other things involved that could be affecting it.

LEADTOOLS Technical Support
   Report 
  09-04-2008, 22:35
roadman is not online. Last active: 9/26/2008 5:05:06 PM roadman

Top 25 Posts
Joined on 06-27-2007
Posts 95
Re: Loading only Wang supported annotations in the toolbar
Reply Quote

I have bought the Multimedia SDK and Medical Suit. I have also unlock these two suit using the given serials from LeadTools Sales.

I further found that the "Object.Remove" is not work for some annotation objects only. 
(annAutomationObj.Id == AnnAutomationManager.StampObjectId) || //not work
(annAutomationObj.Id == AnnAutomationManager.HotspotObjectId) || //not work
(annAutomationObj.Id == AnnAutomationManager.RulerObjectId) || //not work
(annAutomationObj.Id == AnnAutomationManager.ProtractorObjectId) ||  //not work

 

           AnnAutomationManager automationManager;

            RasterCodecs codecs = null;
            AnnAutomationObject annAutomationObj;

            automationManager = new AnnAutomationManager();
            RasterCodecs.Startup();
            codecs = new RasterCodecs();
            automationManager.RasterCodecs = codecs;
            automationManager.RedactionRealizePassword = String.Empty;
            automationManager.UseXPStyleToolBar = true; // enable 14.5 new XP style toolbar -- must be called CreateDefaultObjects();
            automationManager.CreateDefaultObjects();

            for (int idx = 0; idx < automationManager.Objects.Count; idx++)
            {
                annAutomationObj = automationManager.Objects[idx];
                if ((annAutomationObj.Id == AnnAutomationManager.TextRollupObjectId) ||
                    (annAutomationObj.Id == AnnAutomationManager.NoteObjectId) ||
                    (annAutomationObj.Id == AnnAutomationManager.StampObjectId) || //not work
                    (annAutomationObj.Id == AnnAutomationManager.RubberStampObjectId) ||
                    (annAutomationObj.Id == AnnAutomationManager.HotspotObjectId) || //not work
                    (annAutomationObj.Id == AnnAutomationManager.FreehandHotspotObjectId) ||
                    (annAutomationObj.Id == AnnAutomationManager.ButtonObjectId) ||
                    (annAutomationObj.Id == AnnAutomationManager.PointObjectId) ||
                    (annAutomationObj.Id == AnnAutomationManager.RulerObjectId) || //not work
                    (annAutomationObj.Id == AnnAutomationManager.PolyRulerObjectId) ||
                    (annAutomationObj.Id == AnnAutomationManager.ProtractorObjectId) ||  //not work
                    (annAutomationObj.Id == AnnAutomationManager.CrossProductObjectId) ||
                    (annAutomationObj.Id == AnnAutomationManager.EncryptObjectId) ||
                    (annAutomationObj.Id == AnnAutomationManager.AudioObjectId)
                    )
                {

                    automationManager.Objects.Remove(annAutomationObj);

                }
            }

            automationManager.CreateToolBar();
            automationManager.ToolBar.Dock = DockStyle.Right;
            automationManager.ToolBar.BringToFront();
            automationManager.ToolBar.AutoSize = true;
            Controls.Add(automationManager.ToolBar);

 

BTW, Can I create the toolbar first and then add the defaulted toolbar button one by one because I don't want to remove many buttons from the default toolbar , which may introduce some overheard on performance. In addition, I can customize the ordering of the annotation toolbar button.


   Report 
Post
 Page 1 of 2 (18 items) 1 2 »
LEAD Support Fo... » Developer » Annotations » Re: Loading only Wang supported annotations in the toolbar

Powered by Community Server, by Telligent Systems