Skip to content Skip to sidebar Skip to footer

Android Combine Many Bitmaps To One Large One Goes Wrong And Can't Recycle Bitmap

I want to combine many small bitmaps which are contained in ArrayList to one large bitmap. However, I don't know why the large bitmap is looped. It means it seems to copy only the

Solution 1:

I finally found out my problem. It's because of my dummy mistake.

I have to use scrollTo instead scrollBy

After I change to scrollTo, everything works fine. This is really an useful experience.

Solution 2:

According to the documentation of Bitmap.createBitmap(Bitmap),

Returns an immutable bitmap from the source bitmap. The new bitmap may be the same object as source, or a copy may have been made. It is initialized with the same density as the original bitmap.`

Therefore, replace

returnedBitmap = Bitmap.createBitmap(webview.getDrawingCache());

with

returnedBitmap = webview.getDrawingCache().copy(Config.ARGB_8888, false); 

Post a Comment for "Android Combine Many Bitmaps To One Large One Goes Wrong And Can't Recycle Bitmap"