First, the Chinese meaning of the two words is dither (jitter) and Tilemode (tiled)
1, first introduce tilemode (tile)
Its effect is similar to having a background thumbnail that is not stretched but multiple repetitions (similar to the effect of setting a small picture on the desktop of a computer)
[HTML]View Plaincopy
- <XML version= "1.0" encoding="Utf-8"?>
- <LinearLayout
- android:id="@+id/mainlayout"
- xmlns:android="Http://schemas.android.com/apk/res/android"
- Android:layout_width="Fill_parent"
- android:layout_height="Fill_parent"
- android:orientation="Vertical"
- android:background="@drawable/backrepeat"
- >
Backrepeat.xml
[HTML]View Plaincopy
- <bitmap
- xmlns:android="http://schemas.android.com/apk/res/android"
- android:src="@drawable/repeatimg"
- android:tilemode="Repeat"
- android:dither="true" />
Code mode:
[Java]View Plaincopy
- Bitmap Bitmap = Bitmapfactory.decoderesource (Getresources (), R.drawable.icon);
- bitmapdrawable bd = new bitmapdrawable (bitmap);
- Bd.settilemodexy (Tilemode.repeat, tilemode.repeat);
- Bd.setdither (true);
- View.setbackgrounddrawable (BD);
2, again to explain the next dither (jitter)
Dither (Image jitter processing, when each color value is represented below 8 bits, the corresponding image jitter processing can be achieved when the total number of colors can be displayed low (such as 256 colors) also maintain a good display effect: dither on Wikipedia
Two properties on the Android layout dither and Tilemode