LEADTOOLS Support
Document
Document SDK Questions
How to draw annotation in C# using LeadMain OCXControl???
This topic and its replies were posted before the current version of LEADTOOLS was released and may no longer be applicable.
#1
Posted
:
Thursday, March 2, 2006 11:25:20 PM(UTC)
Groups: Registered
Posts: 14
Hi All,
I am using LeadTools Ver 13.0.0.118. I am trying to draw an annotation on the image using Lead Main Control in C#.
I have used Mousedown,mousemove,mouseup and rubberband events and drawn the rectangles.
But these are not permanent annotations on the image.I had tried with
Anncreate method/anncreate event etc but nothing is coming in output.So
can anyone tell me about this how to draw annotation????
Thanks In Advance
Vikas Kohli
#2
Posted
:
Monday, March 6, 2006 12:07:55 AM(UTC)
Groups: Guests
Posts: 3,022
Was thanked: 2 time(s) in 2 post(s)
If you want to draw annotations with the mouse then just set the AnnTool property to the desired annotation type.
#3
Posted
:
Monday, March 6, 2006 12:46:42 AM(UTC)
Groups: Registered
Posts: 14
Hi,
Thanks for reply.I had set this property but then what should be the next step for drawing an annotation???
I had set this property and then tried AnnCreate event, but nothing is drawn on the image.So please advice.
Thanks,
Vikas Kohli
#4
Posted
:
Monday, March 6, 2006 12:56:44 AM(UTC)
Groups: Guests
Posts: 3,022
Was thanked: 2 time(s) in 2 post(s)
When you set this property your mouse cursor will turn into a cross
shape. Press the left mouse button and drag then release.
The annotation will be created and the control should display it
automatically.
#5
Posted
:
Monday, March 6, 2006 3:22:31 AM(UTC)
Groups: Registered
Posts: 14
No No No.. Actually i m trying to draw annotations on the tif files.I
had drawn an annotation with black bondary.But these annotations are
neither persistence nor colored. I have used
DrawFillStyle,DrawFillColor etc. methods but still nothing is producing
in output.Can you tell me the the exact way that i can follow for
drawing an annotaions on tif files???
#6
Posted
:
Tuesday, March 7, 2006 3:42:48 AM(UTC)
Groups: Guests
Posts: 3,022
Was thanked: 2 time(s) in 2 post(s)
The TIF file may be a 1-bit image. This is the most likely reason
why the annotations are not in color. Try useing the ColorRes
method to convert it to 24 bits. I am not sure about the problem
with persistence. Can you please post a small working project
that shows it?
#7
Posted
:
Tuesday, March 7, 2006 7:34:28 PM(UTC)
Groups: Registered
Posts: 14
I am sending you the project as an attachment. Please give a look on this and then let me know.
I am able to draw the annotations on the image but when I zoom in or zoom out, all the annotations get disappeared.
So please advice as soon as possible.
Thanks
Vikas Kohli
#8
Posted
:
Wednesday, March 8, 2006 11:19:46 PM(UTC)
Groups: Registered
Posts: 14
Hi Bashar,
I have written two lines on the buttonClick event that are given below:
m_Lead1.AnnTool = (short)LEADLib.AnnToolConstants.ANNTOOL_RECT;
m_Lead1.AnnUserMode =
(short)LEADLib.AnnUserModeConstants.ANNUSERMODE_DESIGN;
where m_Lead1 is Main Lead Control.
After this, I am able to draw the rectangles on the image.But still I
am not able to use m_Lead1.AnnSetFillMode(,,) &
m_Lead1.AnnSetFillPattern(,,).Because I don't know how to get the
handle to annotation object.
In addition to this, When I use menu options,after right clicking on
the image and then close the application, it gives
System.NullReferenceException. Can you advice whether I have to delete
or release m_Lead1 at the time of closing the application or not?
Please do needful.
Thanks
Vikas Kohli
#9
Posted
:
Thursday, March 9, 2006 5:44:25 AM(UTC)
Groups: Guests
Posts: 3,022
Was thanked: 2 time(s) in 2 post(s)
Use the AnnEnumerate method and trap the AnnEnumerate event. This
event gives you the handle of each enumerated annotation.
About the other problem, you do not need to explicitly free
anything. Attached is a small project that doesn't give any error
on closing. Can you reproduce the problem with it?
#10
Posted
:
Thursday, March 9, 2006 8:38:05 PM(UTC)
Groups: Registered
Posts: 14
Thanks Bashar,
Finally, I am able to drawn the annotations.I had also resolved the second issue as well.
My next step is now to OCR the selected annotation one by one. So for OCRing, can you advice me??
Vikas Kohli
#11
Posted
:
Friday, March 10, 2006 8:55:58 AM(UTC)
Groups: Guests
Posts: 3,022
Was thanked: 2 time(s) in 2 post(s)
Have you checked the OCR demos that ship with the toolkit? These are very simple demos that show you how to perform OCR on images. There are also simple tutorials in the helpfile. Also, keep in mind that the OCR support is provided in our COM, DOTNET and API library, not in the OCX.
#12
Posted
:
Sunday, March 12, 2006 7:40:24 PM(UTC)
Groups: Registered
Posts: 14
Hi Otis,
I am developing the application in C#(Microsoft .Net 2003 Arch.) with Lead Tools Ver 13.0.0.118.
I had checked in the toolkit(in which three parts are there :- ActiveX,COM and API).
So according to you, which library I should use for my application?Please advice.
Thanks & Regards
Vikas Kohli
#13
Posted
:
Monday, March 13, 2006 8:02:49 AM(UTC)
Groups: Guests
Posts: 3,022
Was thanked: 2 time(s) in 2 post(s)
You can use the COM objects in DOTNET or you can upgrade to V14.5 where we now have native DOTNET classes. The V14.5 toolkit ships with complete VB.NET and C# OCR demos to help get you started. If you choose to continue programming with V13, you can use the VB6 COM OCR demos as a guideline because the DOTNET equivalent will not be much different. My recommendation however is that you upgrade because we use a newer OCR engine in V14.5 and the engine we use in V13 is longer being patched or updated.
LEADTOOLS Support
Document
Document SDK Questions
How to draw annotation in C# using LeadMain OCXControl???
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.