harism / android-pagecurl

An example application for creating page curl/flip effect on Android using OpenGL ES.
Apache License 2.0
1.66k stars 610 forks source link

Transparent areas in bitmaps? #96

Open christofferlundqvist opened 8 years ago

christofferlundqvist commented 8 years ago

I tried this with some drawables/bitmaps that has some transparent areas and those will not be transparent, but white. I think it's because of the blend colors mColorBack = Color.WHITE; mColorFront = Color.WHITE; in CurlPage.java.

Is it possible to change something in CurlMesh to fix this? Could be useful if you want pages with round corners for example.

EDIT: Solved using gl.glTexEnvf(GL10.GL_TEXTURE_2D, GL10.GL_TEXTURE_ENV_MODE, GL10.GL_REPLACE); when loading textures in onDrawFrame

asheeshShanu commented 7 years ago

Hi,

I have the same problem, my book application is using the library and the page of my book is look something like given below left_mask

As you can see it has some transparent part as well, but when I bind this image with the library code or Curl page this transparent part appears White. Please help me as I have no experience with the open GL. Any help with the demo code will be appreciated. Thanks in advance.

Edit: I already tried adding gl.glTexEnvf(GL10.GL_TEXTURE_2D, GL10.GL_TEXTURE_ENV_MODE, GL10.GL_REPLACE); in onDrawFrame method under CurlMesh class. But not sure where exactly to put this line in onDrawFrame method.