通过ImageView.setImageUri()使用RAW位图

时间:2015-07-14 08:30:41

标签: android bitmap imageview android-contentprovider

我正在尝试编写内容提供程序,以便通过ImageView.setImageUri()调用将图像发送到另一个进程,我要发送的Bitmap在内存中,由于性能原因,我宁愿避免保存它在磁盘上,甚至对它进行编码,因为在PNG中进行编码可能需要2/3秒,而且由于另一端正在对其进行解码,所以没有多大意义。

所以,我能够使用PipeHelper正确地发送PNG中的图像,但我无法将其发送到“原始”(所以Android Bitmap作为字节直接从内存中发送),有没有选项可以做到这一点?我通过了错误的哑剧类型吗?为什么setImageBitmap()适用于原始位图而setImageUri()不适用?

我知道我可以使用Parcelable Bitmap,但我想克服Parcelable大小限制。最后,如果结束大小不是问题,是否有比PNG更快的编码支持alpha?

0 个答案:

没有答案