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

Double tap Zoom

More
9 years 11 months ago #10477 by digitalpages
Double tap Zoom was created by digitalpages
Hi,

I need create a feature using double tap for enable zoom, but I can't do the layout goes to the position tapped.

Follow my code:

public void doZoom(int x, int y) {
final float scale = m_layout.vGetZoom();
float zoomTo = scale + 1;
if (scale >= maxZoom) {
zoomTo = 1.0f;
}
m_layout.vZoomStart();
final PDFPos pdfPos = PDFGetPos(x, y);
m_layout.vZoomSet(x, y, pdfPos, zoomTo);
m_layout.vZoomConfirmed();
}

Thanks
More
9 years 11 months ago - 9 years 11 months ago #10479 by Davide
Replied by Davide on topic Double tap Zoom
Hi,
if you want a doubleZoom In/Out you only have to add the following line at the end of OnPDFDoubleTapped method of PDFReader class before the return statement:
Code:
Global.zoomStep *= -1;

Maybe this will help you : www.radaeepdf.com/forum/Android-developm...et?limitstart=0#9795

If you want a different behaviour please better explain your needs..
Last edit: 9 years 11 months ago by Davide.
More
9 years 11 months ago #10489 by digitalpages
Replied by digitalpages on topic Double tap Zoom
HI,

I'm using PDFLayoutView and this don't have a onPDFDoubleTapped method.

My code do a zoom, but I need center de pega zoomed in the tapped position, this not work in my code.

Do you recommend I change the view I'm using?

Thanks
More
9 years 11 months ago #10492 by Davide
Replied by Davide on topic Double tap Zoom
Hi,
try to add this method to PDFLayoutView:
Code:
public PDFLayout getLayout(){ return m_layout; }

then change your code with something like that
Code:
PDFLayout layout = m_view.getLayout(); PDFLayout.PDFPos pdfPos= layout.vGetPos((int) x, (int) y);

If it doesn't work, check x and y values...are they correctly passed to your method?
Time to create page: 0.408 seconds
Powered by Kunena Forum