Imposing of images

Problems with Canvas, OpenGL, etc...

Imposing of images

Postby Shota » Tue Jun 08, 2010 5:41 am

Hello! I'm sorry for my english) I have next problem... I need to impose two images and save result in a file. Saving to a file - it's not problem. But I couldn't to impose of images. Please, somebody help me. I need it as soon as possible.
Shota
Freshman
Freshman
 
Posts: 5
Joined: Tue May 18, 2010 6:57 pm

Top

Re: Imposing of images

Postby Shota » Wed Jun 09, 2010 6:32 am

I have been solved my problem. There is:
Code: Select all
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();
      }
Shota
Freshman
Freshman
 
Posts: 5
Joined: Tue May 18, 2010 6:57 pm

Top

Return to Android 2D/3D Graphics - OpenGL Problems

Who is online

Users browsing this forum: No registered users and 6 guests