Microsoft Windows Phone 8.1 support ends (13 Jul 2017)

Microsoft has ended support for Windows Phone 8.1

Questions about iOS development and PDF

Annotation at point

More
IP: 192.168.0.71 12 years 4 months ago - 12 years 4 months ago #6236 by Rossi
Annotation at point was created by Rossi
Hi, i tried to get annotation from touched point. I use the function annotAtPoint but this return the annotation rarely right.
This is my code on touchend
Code:
if ([[m_page GetPage] annotCount]) { NSLog(@"%d",[[m_page GetPage] annotCount]); Page_objsStart(&m_page); PDF_RECT rect; [[[m_page GetPage] annotAtPoint:point.x* m_scale :point.y* m_scale] getRect:&rect]; NSLog(@"%@ ",[[m_page GetPage] annotAtPoint:point.x* m_scale :point.y* m_scale]); NSLog(@"%d ",[[[m_page GetPage] annotAtPoint:point.x* m_scale :point.y* m_scale] type]); NSLog(@"fill color %d ",[[[m_page GetPage] annotAtPoint:point.x* m_scale :point.y* m_scale] getFillColor]); NSLog(@"stroke color %d ",[[[m_page GetPage] annotAtPoint:point.x* m_scale :point.y* m_scale] getStrokeColor]); NSLog(@"stroke width %f ",[[[m_page GetPage] annotAtPoint:point.x* m_scale :point.y* m_scale] getStrokeWidth]); NSLog(@"rect %f",rect.top);

this return a value of annotation property only when i click in a part of the annotation and only for same annotation
Last edit: 12 years 4 months ago by Abdikayrov.
More
IP: 192.168.0.71 12 years 4 months ago - 12 years 4 months ago #6238 by radaee
Replied by radaee on topic Annotation at point
do not pass clicked point to annotFromPoint directly.
use like this:
Code:
PDFV_POS pos; [m_view vGetPos:&pos : point.x * m_scale :point.y * m_scale]; if( pos.pageno >= 0 ) { PDFVPage *vpage = [m_view vGetPage:pos.pageno]; if( !vpage )//shall not happen { return; } PDFPage *page = [vpage GetPage]; if( !page ) return; m_annot = [page annotAtPoint:pos.x: pos.y]; if( m_annot ) { //todo: } }
Last edit: 12 years 4 months ago by .
Time to create page: 0.457 seconds
Powered by Kunena Forum