I've a Image 1280 x 853 in drawables directory. I want to crop that Image
at the center using the Screen Size.
That's the way i get the Screen Size
:
DisplayMetrics displayMetrics = new DisplayMetrics();
getWindowManager().getDefaultDisplay().getMetrics(displayMetrics);
int height = displayMetrics.heightPixels;
int width = displayMetrics.widthPixels;
I thought it would be easy to pick the center of that Image
and go half of screen width
to left and the other half to the right.
I just don't know how to do that.
After I've cropped that Image i want to load it as Splashscreen
Background.
I hope my reasoning is clear.
EDIT:
<ImageView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:id="@+id/imageView"
android:background="@drawable/taskreport_splashscreen"
android:scaleType="centerCrop"/>