Create a copy of the image for Android Development
Define a layout File
Implement logic in mainactivity
Package com. wzw. imagecopy; import android. app. activity; import android. graphics. bitmap; import android. graphics. bitmapFactory; import android. graphics. canvas; import android. graphics. color; import android. graphics. matrix; import android. graphics. paint; import android. OS. bundle; import android. support. v4.widget. slidingPaneLayout. panelSlideListener; import android. view. view; import android. widget. imageView; public class MainActivity extends Activity {private ImageView imageView1; private ImageView imageView2; private Bitmap srcBm; private Bitmap copyBm; @ Overrideprotected void onCreate (Bundle savedInstanceState) {super. onCreate (savedInstanceState); setContentView (R. layout. activity_main); imageView1 = (ImageView) findViewById (R. id. iv1); imageView2 = (ImageView) findViewById (R. id. iv2); srcBm = BitmapFactory. decodeResource (getResources (), R. drawable. ic_launcher); imageView1.setImageBitmap (srcBm); // create a copy of the source image. You can modify the image copyBm = Bitmap. createBitmap (srcBm. getWidth (), srcBm. getHeight (), srcBm. getConfig ();}/*** create a copy of the source image * @ param v */public void copy (View v) {// prepare a Canvas canvas Canvas = new Canvas (copyBm); // prepare the Paint brush paint = new Paint (); paint. setColor (Color. BLACK); // 3. start to draw Matrix m = new Matrix (); // draw the canvas according. drawBitmap (srcBm, m, paint); // draw an image like the source image imageView2.setImageBitmap (copyBm );}}