- Posts: 50
- Thank you received: 0
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
IP: 192.168.0.71
11 years 11 months ago #6289
by apait
move to point on pdf where click occured was created 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?
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?
IP: 192.168.0.71
11 years 11 months ago #6298
by apait
Replied by apait on topic move to point on pdf where click occured
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...
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...
IP: 192.168.0.71
11 years 11 months ago #6319
by apait
Replied by apait on topic move to point on pdf where click occured
any answer?
IP: 192.168.0.71
11 years 11 months ago #6329
by radaee
Replied by radaee on topic move to point on pdf where click occured
like this:
m_pdv.vSetScale(m_pdv.vGetScale() + Global.zoomStep, m_pdv.GetWidth()/2, m_pdv.GetHeight()/2);
m_pdv.vSetScale(m_pdv.vGetScale() + Global.zoomStep, m_pdv.GetWidth()/2, m_pdv.GetHeight()/2);
IP: 192.168.0.71
11 years 11 months ago #6435
by apait
Replied by apait on topic move to point on pdf where click occured
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?
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