eschao / android-PageFlip

3D Style Page Flip on Android
Apache License 2.0
1.74k stars 262 forks source link

Zoom in Page Flip #10

Closed OleksandrGrument closed 7 years ago

OleksandrGrument commented 7 years ago

Hi i'm a newbie with open gl. I use your example and want to zoom with two fingers a picture. I have add in code ScaleGestureDetector and Listener. Where should i change scale ? Thanks.

eschao commented 7 years ago

OpenGL use bitmap as texture to draw screen. For zoom in/out, you can do: 1) Zoom your bitmap which is used as texture to draw screen 2) Set the zoomed bitmap as texture of OpenGL, e.g:

page.setFirstTexture(mBitmap);

3) Call drawPageFrame() of PageFlip class to draw bitmap on screen

Hope it can help you.

OleksandrGrument commented 7 years ago

Big thanks!

vijayxd commented 5 years ago

how to navigate zoomed bitmap like google maps

eschao commented 5 years ago

how to navigate zoomed bitmap like google maps

I think there are many code examples for your request on internet. Please try google first. thanks!

yenenahmet commented 4 years ago

OpenGL use bitmap as texture to draw screen. For zoom in/out, you can do:

  1. Zoom your bitmap which is used as texture to draw screen
  2. Set the zoomed bitmap as texture of OpenGL, e.g:
page.setFirstTexture(mBitmap);
  1. Call drawPageFrame() of PageFlip class to draw bitmap on screen

Hope it can help you.

public void changeBitmap(final Bitmap bitmap){
    final Page page = mPageFlip.getFirstPage();
  ///  if (!page.isFirstTextureSet()) {
        drawPage(mPageNo);
        page.setFirstTexture(bitmap);
   // }

    mPageFlip.drawPageFrame();

}

// Not Working