Bitmap bitmap = Bitmap.createBitmap(200, 200, Config.RGB_565);
Bitmap bt = BitmapFactory.decodeResource(this.getResources(), R.drawable.yug);
Bitmap bt2 = BitmapFactory.decodeResource(this.getResources(), R.drawable.icon);
Canvas c = new Canvas(bitmap);
c.drawBitmap(bt, new Matrix(), new Paint());
c.drawBitmap(bt2, new Matrix(), new Paint());
ImageView i = (ImageView)this.findViewById(R.id.image);
i.setImageBitmap(bitmap);
File test = new File("/sdcard/DCIM/Camera/test.png");
FileOutputStream out = null;
try {
out = new FileOutputStream(test);
} catch (FileNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
bitmap.compress(Bitmap.CompressFormat.PNG, 100, out);
try {
out.close();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
Return to Android 2D/3D Graphics - OpenGL Problems
Users browsing this forum: Google [Bot] and 2 guests