here is my solution :
(very simple with the Bitmap from android SDK ;) )
its NOT possible to load non power of two size bitmap as texture
but it's very easy to resize our bitmap ;)
=>
[syntax="java"]
//correct the bitmap if its not a power of two width
if(((Math.log((double)bitmap.getWidth())/Math.log(2.0))
-
Math.floor((Math.log((double)bitmap.getWidth())/Math.log
(2.0)))) != 0){
//the bitmap width isn't a power of two.
int aimWidth = (int) Math.pow(2,Math.ceil(Math.log((double)
bitmap.getWidth())/Math.log(2.0)));
bitmap = Bitmap.createScaledBitmap(bitmap, aimWidth,
bitmap.getHeight(), false);
//you can adapt the height in the same way if needed.
}
[/syntax]
;)
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---