Welcome Guest! To enable all features, please Login or Register.

Notification

Icon
Error

Options
View
Last Go to last post Unread Go to first unread post
#1 Posted : Friday, August 25, 2006 8:20:31 PM(UTC)

Amit  
Amit

Groups: Registered
Posts: 101


Hi,

I am using LEADTools 14 with Visual Basic 6.

In my application, I need to display 16 images at a time on the screen.  For that purpose, I used control array of LEAD Raster View control.  I need to create 16 different LEAD Raster Annotation objects to attach with each LEAD Raster View.  I am unable to create control array of those LEAD Raster Annotation object.

Is there any way to dynamically create instance of LEAD Raster Annotation object ?

 

Try the latest version of LEADTOOLS for free for 60 days by downloading the evaluation: https://www.leadtools.com/downloads

Wanna join the discussion? Login to your LEADTOOLS Support accountor Register a new forum account.

#2 Posted : Monday, August 28, 2006 3:21:38 AM(UTC)
Maen Hasan

Groups: Registered, Tech Support
Posts: 1,326

Was thanked: 1 time(s) in 1 post(s)

Hello,

You may try to create the LEADRasterAnnotation dynamically by using the following code:
+---------------------------+
Dim X As LEADRasterAnnotation
Dim Y As LEADRasterAnnotation
Dim RasterIO As LEADRasterIO
Const strLic As String = "LEADTOOLS OCX Copyright (c) 1991-2004 LEAD Technologies, Inc."
Dim FactoryObj As New LTRASTERLib.LEADRasterFactory
Dim nRet As Integer

Set X = FactoryObj.CreateObject("LEADRasterAnnotation.LEADRasterAnnotation.140", strLic)
Set Y = FactoryObj.CreateObject("LEADRasterAnnotation.LEADRasterAnnotation.140", strLic)

X.AnnParentRasterView = LEADRasterView1
Y.AnnParentRasterView = LEADRasterView2
+---------------------------+

Thanks,
Maen Badwan
LEADTOOLS Technical Support
 
#3 Posted : Monday, August 28, 2006 4:36:23 AM(UTC)

Amit  
Amit

Groups: Registered
Posts: 101


Hi,

The solution you provided need to declare the variables with that name.  I donot want to do the same.

As I can create control array of LeadRasterView control, How can I create Array of LeadRasterAnnotation ?

Creating array, I would be able to decide number of objects to be created at run time.  I think, this will be the perfect solution for me.

Waiting for reply.

 
#4 Posted : Tuesday, August 29, 2006 10:54:37 PM(UTC)
Maen Hasan

Groups: Registered, Tech Support
Posts: 1,326

Was thanked: 1 time(s) in 1 post(s)

Hello,

Do you mean that you want to create LeadRasterAnnotation object for each new LeadRasterView control that you create?

Thanks,
Maen Badwan
LEADTOOLS Technical Support
 
#5 Posted : Wednesday, August 30, 2006 5:16:31 AM(UTC)

Amit  
Amit

Groups: Registered
Posts: 101


Hi,

Yes, I need to create new Annotation object or each new leadRasterView control.

I need to load and display 2, 4, 9, or 16 images at a time on screen to user.  User will draw annotations on all these 16 images.  I tried using single Annotation object.  But single annotation object can be linked to single leadRasterView control using ParentRasterView property at a time.  To link with another leadRasterView, I need to disconnect it form current leadRasterView control.  As soon as I disconnect it, the annotations drawn on current image disappears.

The situation become worst when I come to my Reporting Section.  In this section, user may load unlimited (may be 10 or 100 or 200 or more) images.  For that, I can generage unlimited leadRasterView controls using control array.  But I cannot create array of leadRasterAnnotation.  I need to define leadRasterAnnotation object in design time only.  That creates limitation in my reporting section.  Currently I defined 100 Annotation objects and I allowed only 100 images to be added to report.  This is limitation of my report and user strongly opposing this.

Another problem is while coding.  I need to handle AnnChange, AnnCreate etc events in my coding.  I need to repeat the same code 100 times for each annotation object.  If any bug found, I need to update it at 100 places.

Third problem is unnecessary memory usage.  In reporting section, I allowed 100 images to be added. For that, I created 100 annotation objects at design time.  If user adds only 2 images, still all 100 annotation objects will be there in memory which is badly affect the overall performance of system.

I also tried AnnotationBar object which have same behaviour as Annotation object and which is also not solving my problem.

From above explaination, you might be understood my problem.  The solution I am thinking is to create array of annotation object same as I created for leadRasterView.  It will also imporve my code maintainability.

If it is not possible to create control array of annotation object, please tell me other solution to solve above three problems.

Thanks and waiting

 
#6 Posted : Monday, September 4, 2006 12:42:24 AM(UTC)
Maen Hasan

Groups: Registered, Tech Support
Posts: 1,326

Was thanked: 1 time(s) in 1 post(s)

Hello,

I am attaching a small VB 6.0 project that shows how to create LEADRasterAnnotation control array and bind it's elements with LEADRasterView control array. Please check the project and let me know if this helps.

Thanks,
Maen Badwan
LEADTOOLS Technical Support
File Attachment(s):
COMv145_Annotaions_Dynami.zip (3kb) downloaded 38 time(s).
 
#7 Posted : Tuesday, September 5, 2006 5:15:51 AM(UTC)

Amit  
Amit

Groups: Registered
Posts: 101


Hi,

I downloaded your sample and tested.  It worked very fine.  Thanks for your help.

But it donot work with WithEvents statement.  Your declaration statement is like follows -

Dim RasAnnot() As LeadRasterAnnotation.

If I use it like this, it works fine.  But it donot gives events for leadRasterAnnotation objects.  I need to handle the events of leadRasterAnnotation object.  To handle events, I need to declare it as follows -

Dim WithEvents RasAnnot() As LeadRasterAnnotation.

For above declaration, VB gives syntax error.

Do you have any solution ?

 
#8 Posted : Wednesday, September 6, 2006 3:58:14 AM(UTC)
Maen Hasan

Groups: Registered, Tech Support
Posts: 1,326

Was thanked: 1 time(s) in 1 post(s)

Hello,

You might be able to do that indirectly, by creating a small VB ActiveX control that contains an instance of the Annotations COM object, and add a number of events in this ActiveX control similar to the events you need. After that, put the control on a form as a control array and let the Annotation event handlers raise the events of your control.

Thanks,
Maen Badwan
LEADTOOLS Technical Support
 
#9 Posted : Friday, September 8, 2006 10:43:59 PM(UTC)

Amit  
Amit

Groups: Registered
Posts: 101


Thanks a lot Mean, its working exactly like my requirement.

I tried your solution in sample project.  And it is working.  While integrating with main project, if I face any problem, I will contact you back.

Thanks again.

 
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.

Powered by YAF.NET | YAF.NET © 2003-2024, Yet Another Forum.NET
This page was generated in 0.113 seconds.