开发者

Slicing a Picture

I have a

Picture pic = webView.capturePicture();

which is potentially huge and needs to be sliced into multiple chunks that will fit the screen.

The naive thing I'm currently doing is

Bitmap bm = Bitmap.createBitmap(screenWidth开发者_如何学Python, screenHeigth, RGB_565);
Canvas canvas = new Canvas(bm);
canvas.drawPicture(pic);
fullScreenImageView.setImageBitmap(bm);

What would be the efficient way to "paginate" the Picture to be displayed on screen (these "pages" will be later replacing one another)?


Can't you just call getDrawingCache() on the webView? You won't be creating any new bitmap because it is the cache of the webview which is uses to scroll.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜