在Android中呈现的ImageView两个图像? [英] Render Two images in ImageView in Android?

查看:124
本文介绍了在Android中呈现的ImageView两个图像?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想编写一个应用程序,这将让我来渲染多个图像到Android中的ImageView的。我能找到一个事务所位图填充的方法。但是,似乎有没有办法获得两个图像的ImageView来呈现的(每个占位一半的渲染空间)。任何帮助将是非常美联社preciative。

I am trying to write an application, that would allow me to render multiple images onto an ImageView in Android. I can find the method to populate it with a sigle bitmap. But, there seems to be no way of getting two images to render in ImageView (Each occuping half the render space). Any help would be really appreciative.

谢谢, 德Costo。

Thanks, De Costo.

推荐答案

您可以尝试从多个图像创建一个单独的位图。

You can try to create one single bitmap from the multiple images.

您可以尝试用原始数据做了,通过提取图像为32位int ARGB像素阵列的像素数据,在一个大数组合并,并创建一个新的位图,使用位图类的方法像copyPixelsToBuffer(),createBitmap()和的setPixels()。

You can try to do it with the raw data, by extracting the pixel data from the images as 32-bit int ARGB pixel arrays, merge in one big array, and create a new Bitmap, using the methods of the Bitmap class like copyPixelsToBuffer(), createBitmap() and setPixels().

我想你也可以用做直接COM pressed格式的数据流和BitmapFactory类像德codeByteArray方法()。

I think you can also do it by using directly compressed format data and streams and the methods of the BitmapFactory class like decodeByteArray().

如果你没有使用太多的图像一次,你可以使用不同的ImageViews和回收利用他们/重载的资源。我有一个pretty的坎坷经历的东西,如最近的,但它可以做到的。

If you aren't using too many images at once you can use separate ImageViews and recycle them/reload the resources. I had a pretty rough experience with something like that recently, but it can be done.

祝你好运。

这篇关于在Android中呈现的ImageView两个图像?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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