11-18-2008, 6:51
|
rulingking
Joined on 12-17-2006
Posts 13
|
|
|
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
|
|
|
|