我有我需要如何将位图转换为视图?
- 分配给一个变量,并转换为位图
- 应用色调功能,它
- ,并把它放回去
一个back.png文件a = BitmapFactory.decodeResource(this.getResources(),R.drawable.back); b = Hue(a); View c = (View)findViewById(R.drawable.back); ///need to make View C = Bitmap B ... but how?
这是我的代码到目前为止,一切正常,只是我不知道如何分配我的位图“b”回到查看“C”...任何想法?
谢谢!
backrepeat.xml
<?xml version="1.0" encoding="utf-8"?>
<bitmap xmlns:android="http://schemas.android.com/apk/res/android"
android:src="@drawable/back"
android:tileMode="repeat" />
AbsoluteLayout al = (AbsoluteLayout)findViewById(R.id.setLay);
Drawable dback = al.getBackground();
a = ((BitmapDrawable)dback).getBitmap();
//b = Hue(a);
d =new BitmapDrawable(a);
al.setBackgroundDrawable(d);
编辑,累了的那一个,但是从绘制转换为位图,然后再回到使得洛斯被tileing。我刚刚得到一个位图拉伸整个屏幕...
c.setImageBitmap(b); – ingsaurabh