Microsoft Windows Phone 8.1 support ends (13 Jul 2017)

Microsoft has ended support for Windows Phone 8.1

Questions about Android development and PDF

move to point on pdf where click occured

More
IP: 192.168.0.71 11 years 11 months ago #6289 by apait
hi,

i have a pdf, on doubletap i want to zoom into the pdf and center it on the coordinate where the doubletap was.

In ReaderController you have following code, which i extended:

public boolean OnPDFDoubleTapped(float x, float y)
{
this.m_pdv.vSetScale(this.m_pdv.vGetScale() +1, (int)x, (int)y);
return false;
}

zoom works, but the pdf only jumps to the top/left corner.

i tried following, but without any luck:
this.m_pdv.vSetPos(pos, (int)x, (int)y)

so, how can i just move to a point on the pdf, where i detected a click?
More
IP: 192.168.0.71 11 years 11 months ago #6298 by apait
okay, my bad, i just forgot to return true for the gesturelistener...

works:

public boolean OnPDFDoubleTapped(float x, float y){
m_pdv.vSetScale(m_pdv.vGetScale() + Global.zoomStep, x, y);
return true;
}

but is it possible to "center" the point where i the click occured?

now i'm zooming in and the point on the pdf where i clicked stays... i would like to move the pdf, so the point where i clicked is centered...
More
IP: 192.168.0.71 11 years 11 months ago #6319 by apait
any answer?
More
IP: 192.168.0.71 11 years 11 months ago #6329 by radaee
like this:
m_pdv.vSetScale(m_pdv.vGetScale() + Global.zoomStep, m_pdv.GetWidth()/2, m_pdv.GetHeight()/2);
More
IP: 192.168.0.71 11 years 11 months ago #6435 by apait
no, thats not working...
with m_pdv.GetWidth()/2, m_pdv.GetHeight()/2 it just centers the zoomed in page, regardless where the click occured.

any other ideas? ;)
Time to create page: 0.513 seconds
Powered by Kunena Forum