阅读JPG作为Android的RGB888 [英] Read in JPG as RGB888 on Android

查看:686
本文介绍了阅读JPG作为Android的RGB888的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图用BitmapFactory .jpg格式阅读。我希望得到一个RGB888格式的位图,但我一直似乎得到RGB565。反正有没有改变呢?

I'm trying to read in a .jpg using BitmapFactory. I want to get a RGB888 formatted bitmap, but I keep seeming to get RGB565. Is there anyway to change this?

推荐答案

BitmapFactory方法可以让你通过一个BitmapFactory.Options实例。您可以使用BitmapFactory.Options来specifcy的在preferredConfig,它定义位图格式解码后返回,只需将其设置为Bitmap.Config.ARGB_8888。

BitmapFactory methods let you pass a BitmapFactory.Options instance. You can use BitmapFactory.Options to specifcy the inPreferredConfig, which defines the format of the Bitmap returned after decoding, just set it to Bitmap.Config.ARGB_8888.

这篇关于阅读JPG作为Android的RGB888的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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