Welcome to LEAD Support Forum Login | Register | Faq  

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

(VB6) Problem while positioning TEXT_POINTER and PROTRACTOR!!
Started by rulingking at 11-18-2008 6:51. Topic has 8 replies.

Print Search « Previous Thread Next Thread »
  11-18-2008, 6:51
rulingking is not online. Last active: 11/19/2008 3:47:12 PM rulingking

Top 500 Posts
Joined on 12-17-2006
Posts 13
(VB6) Problem while positioning TEXT_POINTER and PROTRACTOR!!

Attachment: Positioning Annotation.zip
Reply Quote
Hi all,

I am facing two problems for implementing the repositioning in annotations.
For reference attached zip file with sample application and jpg image.

I need to reposition annotation after resizing image in my application.
Data Flow is as follows:
1) Resize image in another LeadRasterView control
2) Copy and paste annotations on this resized image.
3) Calculate its values as in proportion to new resized image.
4) Set new values to annotation and position it.

The problems currently annoy me are:
1) TEXT_POINTER annotation is not positioned to exact location in resized image as it was drawn on original image by using AnnGetPointX, AnnGetPointY and AnnSetPoints method.
For this also tried by setting the AnnRectLeft, AnnRectTop, AnnRectWidth and AnnRectHeight but results are not achieved.

2) PROTRACTOR Annotation - on calling AnnRealize method the length of protractor is changed in my original application but the same thing is working exactly as needed in sample application.
Problem2.Jpg image notifies this problem.

The main factors which are responsible for setting length after resizing image and annotation are:
i) Bitmap DPI and ii) Annotation DPI (AnnGetBitmapDpiX, AnnGetBitmapDpiY)
Though after reading these factors on repositioning Protractor, annotation are set as per the calculated values.

The third thing might be responsible for such behavior is annotation settings applied while drawing on Original Image
The Settings done are:
RasterAnn.AnnSetLineWidth hAnnObject, tempLineWidth, False
RasterAnn.AnnSetFontName hAnnObject, tempFontName, False
RasterAnn.AnnSetFontSize hAnnObject, Val(annFontSize), False
RasterAnn.AnnSetForeColor hAnnObject, tempForeColor, False
RasterAnn.AnnTicMarkLength(hAnnObject) = 0
RasterAnn.AnnSetUnit hAnnObject, tempRulerUnit + ANN_UNIT_DEF_ABBR,vbNullString, 2, False
RasterAnn.AnnSetLineStyle hAnnObject, Val(tempLineStyle), False
RasterAnn.AnnSetShowFlags hAnnObject, ANN_SHOW_LENGTH + ANN_SHOW_GAUGE, False
RasterAnn.AnnSetGaugeLength hAnnObject, 6, False

As for the first problem please tell me how should I achieve repositioning TEXT_POINTER annotation.
And for the second problem is there any other settings needed to done for not changing length while call to AnnRealize method ?


Thanks,,,,,
   Report 
  11-18-2008, 6:56
rulingking is not online. Last active: 11/19/2008 3:47:12 PM rulingking

Top 500 Posts
Joined on 12-17-2006
Posts 13
Re: (VB6) Problem while positioning TEXT_POINTER and PROTRACTOR!!
Reply Quote
I am using Leadtools V14.0 with VB6
having Patch file version for
ltkrn14n.dll - 14.5.0.2
   Report 
  11-18-2008, 11:46
Adnan Ismail is not online. Last active: 1/6/2009 4:12:02 PM Adnan Ismail



Top 10 Posts
Joined on 07-31-2006
Posts 1,364
Re: (VB6) Problem while positioning TEXT_POINTER and PROTRACTOR!!
Reply Quote
I have downloaded your project and still checking it. I will get back to you with my result tomorrow.

Also, I noticed that you are using a very old build of LEADTOOLS DLL. Please send an email to support@leadtools.com with your LEADTOOLS toolkit serial number to get the latest patches.
Adnan Ismail
LEADTOOLS Technical Support

   Report 
  11-19-2008, 6:02
rulingking is not online. Last active: 11/19/2008 3:47:12 PM rulingking

Top 500 Posts
Joined on 12-17-2006
Posts 13
Re: (VB6) Problem while positioning TEXT_POINTER and PROTRACTOR!!
Reply Quote
Hi Adnan,,

The first problem for positioning TEXT_POINTER is solved. I found that I am setting TEXT_POINTER points incorrectly. Except setting only three points I am setting all points, but it works for now. Will back to you if caught up with another problem in this case.

Please help me for second problem in PROTRACTOR, changing its length values after call to AnnRealize method.

As I the problem cannot reproduced in the sample application, I sent you the Jpg image from my original application. Any other factors which are responsible for such behavior's or any steps to avoid changing annotation's measurements will be helpful to me on this issue.

Also is there any method or property to set RTF Annotations internal fontsize, as after resizing RTF annotation and setting AnnSetFontSize could not be seen to affect on internal Text FontSize.

Looking forward for your reply ......


Thanks again .....




   Report 
  11-19-2008, 11:16
Adnan Ismail is not online. Last active: 1/6/2009 4:12:02 PM Adnan Ismail



Top 10 Posts
Joined on 07-31-2006
Posts 1,364
Re: (VB6) Problem while positioning TEXT_POINTER and PROTRACTOR!!
Reply Quote
About the PROTRACTOR problem you are facing. I noticed on the image you sent me that the angle is also different. On the original image it is 35.01 degree and on the resized image it is 35.27 degree. Do you realize the annotations on image before or after you resize it?

About the new question you posted, I recommend that you create a new post for it since it is completely not related to the original problem on this thread.
Adnan Ismail
LEADTOOLS Technical Support

   Report 
  11-20-2008, 0:32
rulingking is not online. Last active: 11/19/2008 3:47:12 PM rulingking

Top 500 Posts
Joined on 12-17-2006
Posts 13
Re: (VB6) Problem while positioning TEXT_POINTER and PROTRACTOR!!
Reply Quote
Hi,,

As per the flow in my attached sample application.
First I resize the image, then reposition annotations.
As after changes in annotations width and height its certain that there is change in annotations measurements. So for displaying the correct measurements as per the original I calculated the DPI values and set it to annotations so that they will show needed measurements.
And lastly realize them.


Regds,,,
   Report 
  11-20-2008, 11:22
Adnan Ismail is not online. Last active: 1/6/2009 4:12:02 PM Adnan Ismail



Top 10 Posts
Joined on 07-31-2006
Posts 1,364
Re: (VB6) Problem while positioning TEXT_POINTER and PROTRACTOR!!
Reply Quote
I was able to see the behavior using your application. It seems that the measurement is multiplied by the scale factor you used to resize the image. However, when I ran your project, I was able to see that for a second then the measurements returned to normal. I hope that this can give you a clue where the problem might be.


Adnan Ismail
LEADTOOLS Technical Support

   Report 
  11-21-2008, 8:04
rulingking is not online. Last active: 11/19/2008 3:47:12 PM rulingking

Top 500 Posts
Joined on 12-17-2006
Posts 13
Re: (VB6) Problem while positioning TEXT_POINTER and PROTRACTOR!!
Reply Quote
Hello Adnan,,,

I guess the problem is point out. It is with the AnnGetDistance2 method which I called twice in RepositionAnnotation Sub.
For the very first instance using AnnGetDistance2 can fill the Distance Property with the measurement values as they are.

At the second instance after resizing annotation I read the updated distance for annotation by again calling AnnGetDistance2 method. But at this time the Distance property is not updated with new distance rather it returns the old distance as read at the first instance. Here my calculations doing wrong things as both Distances are equal.

I have faced this problem before that AnnGetDistance2 method will not filled its sub properties instantly. Thats why I used a 1 sec. timer in call to AnnGetDistance2. Thats why the annotations are updated with new values after a seconds. This works fine in sample application but in my original application using the timer upto 10 secs. interval also results to not updating Distance property with new values.

How should I get the updated measurement values instantly in Distance Property after calling it in second instance ?

Thanks !!!


   Report 
  11-23-2008, 9:02
Adnan Ismail is not online. Last active: 1/6/2009 4:12:02 PM Adnan Ismail



Top 10 Posts
Joined on 07-31-2006
Posts 1,364
Re: (VB6) Problem while positioning TEXT_POINTER and PROTRACTOR!!
Reply Quote
I found the timer in the application you sent me. I deleted it and your application worked fine without it, annotations were burned . I am using the latest build of LEADTOOLS v14 DLLs 14.5.0.77. Is it the same build number you have?

Adnan Ismail
LEADTOOLS Technical Support

   Report 
Post
LEAD Support Fo... » Developer » Annotations » (VB6) Problem while positioning TEXT_POINTER and PROTRACTOR!!

Powered by Community Server, by Telligent Systems