¡@

Home 

2014/10/16 ¤W¤È 08:22:50

android Programming Glossary: returnedbitmap

Android set image as wallpaper

http://stackoverflow.com/questions/11938182/android-set-image-as-wallpaper

i tested below code and it is working. fetch bitmap from view public static Bitmap getBitmapFromView View view Bitmap returnedBitmap Bitmap.createBitmap view.getWidth view .getHeight Bitmap.Config.ARGB_8888 Canvas canvas new Canvas returnedBitmap Drawable.. returnedBitmap Bitmap.createBitmap view.getWidth view .getHeight Bitmap.Config.ARGB_8888 Canvas canvas new Canvas returnedBitmap Drawable bgDrawable view.getBackground if bgDrawable null bgDrawable.draw canvas else if we unable to get background drawable.. get background drawable then we will set white color as wallpaper canvas.drawColor Color.WHITE view.draw canvas return returnedBitmap public void setWall int i WallpaperManager myWallpaperManager WallpaperManager.getInstance getApplicationContext try below..

Convert view to bitmap on Android

http://stackoverflow.com/questions/5536066/convert-view-to-bitmap-on-android

is my solution public static Bitmap getBitmapFromView View view Define a bitmap with the same size as the view Bitmap returnedBitmap Bitmap.createBitmap view.getWidth view.getHeight Bitmap.Config.ARGB_8888 Bind a canvas to it Canvas canvas new Canvas returnedBitmap.. Bitmap.createBitmap view.getWidth view.getHeight Bitmap.Config.ARGB_8888 Bind a canvas to it Canvas canvas new Canvas returnedBitmap Get the view's background Drawable bgDrawable view.getBackground if bgDrawable null has background drawable then draw it..