This topic and its replies were posted before the current version of LEADTOOLS was released and may no longer be applicable.
#1
Posted
:
Monday, November 19, 2007 1:34:51 PM(UTC)
Groups: Registered
Posts: 9
Please could you help as I have been trying to do this for hours. I am able to draw annotation using annAutomation, however I am able to save the image but not with the annotations in it, see code below:
' Leadtools variables
' Automation Manager used in managing the automation mode.
Private annAutomationManager As AnnAutomationManager
Private automation As AnnAutomation
Private annCodecs As AnnCodecs
Private tagFormat As AnnCodecsTagFormat
Private Sub frmCommManager_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
' Lead tools info
' Lead tools info
' enable 14.5 new rotate control points
' create and set up the automation manager
annAutomationManager = New AnnAutomationManager
' enable 14.5 preserve aspect ratio
annAutomationManager.MaintainAspectRatio = True
' You can instruct the manager to create the default (all) automation objects.
' comment out the call to CreateMyAutomationObjects and call this instead:
annAutomationManager.CreateDefaultObjects()
' create the toolbar and add it to the form
annAutomationManager.CreateToolBar()
'Controls.Add(annAutomationManager.ToolBar)
' set up the automation (will create the container as well)
automation = New AnnAutomation(annAutomationManager, Me.rasterViewer)
' set up this automation as the active one
automation.Active = True
end sub
Public Sub save()
Dim Codecs As RasterCodecs = New RasterCodecs()
RasterCodecs.CodecsPath = "C:\Program Files\LEAD Technologies, Inc\LEADTOOLS EVAL 14.5\Bin\Dotnet\v11"
Dim memoryStream As New System.IO.MemoryStream
Dim bits As Integer = Me.rasterViewer.Image.BitsPerPixel
Codecs.Save(New RasterImage(Me.rasterViewer.Image), "C:\temp\ann1.tif", RasterImageFormat.Tif, bits)
Dim tag As RasterTagMetadata = annCodecs.SaveToTag(automation.Container, tagFormat)
Codecs.WriteTag("C:\temp\ann1.tif", 1, tag)
end sub
Could you please point out where I am going wrong and if possible correct my sample code.
I am using v14.5 .Net Class
Thanks in advance
Simon
#2
Posted
:
Tuesday, November 20, 2007 11:05:26 AM(UTC)
Groups: Registered, Tech Support, Administrators
Posts: 764
What build of Leadtools.dll are you using (14.5.0.x)?
Are you getting any errors?
Why are you creating a new RasterImage in the Codecs.Save call? Assuming that Me.rasterViewer is a RasterImageViewer, the Image property already is a RasterImage and you don't need to pass it to the constructor. I don't know if this is causing problems, but it's certainly frivolous.
Have you been able to get the help file's example for SaveToTag to work?
#3
Posted
:
Tuesday, November 20, 2007 12:32:57 PM(UTC)
Groups: Registered
Posts: 9
I am using 14.5.0.68
I am not getting any errors, all code seems to be processed.
To be honest I am having a really hard time trying to get this to save, hence the request for an example. I have been unable to get the SaveToTag to work even when working through the examples in the help file.
Your help in this matter would be greatly appreshiated.
Simon
#4
Posted
:
Wednesday, November 21, 2007 4:36:42 AM(UTC)
Groups: Registered, Tech Support, Administrators
Posts: 764
I've made a small working project based off of your code to help you get started. You need to:
1. Click the Load Image button to load an image without annotations
2. Draw some annotations on the image.
3. Click the Save Image and Annotatoins button
4. Remove the annotations
5. Click the Load Image and Annotations button.
If this does not work, then please send an email to
support@leadtools.com in order to get the download instructions for the latest patch. For verification purposes, I need you to include the following information:
1. The company you work for
2. The LEADTOOLS serial number(s) you own (if you are evaluating, just say so and we'll send you the eval patch)
3. The name(s) of the developer(s) using the serial number
4. A link to this forum post
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.