so I have this bitmap that I want to use as the background for the view, but the bitmap can sometimes be larger than the view.
let's say my bitmap is 500x500 px and my look is 200x200px
when I set the bitmap as the background for the view, the view is stretched to the size of the bitmap (500x500) ...
I tried setting gravity to clip_horizontal | clip_vertical, but that didn't help ...
<?xml version="1.0" encoding="utf-8"?> <bitmap xmlns:android="http://schemas.android.com/apk/res/android" android:src="@drawable/old_wall" android:tileMode="repeat" android:gravity="top|left|clip_horizontal|clip_vertical" />
how can i get a bitmap to crop instead of a stretched view to the size of the bitmap?
source share