[英]Displaying bitmaps
I need help with displaying a bitmap. 我需要显示位图的帮助。 I am using a class which is extending Activity.
我正在使用扩展Activity的类。 Where would I put this?
我该放在哪里?
Mybitmap = BitMapfactory.decode resource(getresource,R.drawable.bit);
Also how would I draw it on the screen? 另外我将如何在屏幕上绘制它?
you should use ImageView... 您应该使用ImageView ...
put ImageView in you layout with "myImage" id and in activity do like this : 将ImageView放在具有“ myImage” ID的布局中,并在活动中这样做:
ImageView mImg = (ImageView) findViewById(R.id.myImage);
mImg.setImageBitmap(Mybitmap);
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.