在 Android 中仅加载位图文件的一部分 [英] Loading only part of a bitmap file in Android

查看:21
本文介绍了在 Android 中仅加载位图文件的一部分的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想将位图图像的裁剪版本加载到位图对象中,而不加载原始位图.

I would like to load a cropped version of a bitmap image into a Bitmap object, without loading the original bitmap as well.

如果不编写自定义加载例程来处理原始数据,这完全可能吗?

Is this at all possible without writing custom loading routines to handle the raw data?

谢谢,桑德

推荐答案

实际上很简单.使用

Bitmap yourBitmap = Bitmap.createBitmap(sourceBitmap, x to start from, y to start from, width, height)

更新:使用 BitmapRegionDecoder

这篇关于在 Android 中仅加载位图文件的一部分的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆