package com.example.androidcolor;
import android.os.Bundle;
import android.app.Activity;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.widget.ImageView;
public class MainActivity extends Activity {
ImageView targetImage;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
targetImage = (ImageView)findViewById(R.id.target);
//Load bitmap locally in APK
Bitmap srcBitmapLocal = BitmapFactory.decodeResource(
getApplicationContext().getResources(),
R.drawable.ic_launcher);
targetImage.setImageBitmap(srcBitmapLocal);
}
}
![Convert a Drawable to bitmap thumbnail](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiH1vHlE3ndQMCy9f9CxIJpXcsPpxjdKZvxnY90BSmWpPklny5GoKO6GUIT0UH5KESIg5tPxHXvFhL7BCpNw33DlGiPzEUrGZj20JnCy_hGjDa7k-e9jeBVL2prILRDL2ex1rRsNecl4P_T/s72-c/AndroidColor_01.png)
Title: Convert a Drawable to bitmap
Rating: 100% based on 99998 ratings. 10 user reviews.
Post by 7:19 AM
Rating: 100% based on 99998 ratings. 10 user reviews.
Post by 7:19 AM
0 comments:
Post a Comment