javaandroidbufferedimagegraphics2dbitmapfactory

Finding Android equivalent code for graphics2D


I have been trying to get an Android equivalent code for the following:

private BufferedImage user_space(BufferedImage image)
{
    BufferedImage new_img  = new BufferedImage(image.getWidth(), image.getHeight(), BufferedImage.TYPE_3BYTE_BGR);
    Graphics2D    graphics   = new_img.createGraphics();
    graphics.drawRenderedImage(image, null);
    graphics.dispose(); 
    return new_img;
}

I want an android equivalent of Graphics2D. I have been searching for a while and found out that Canvas in android can do some similar tasks as performed by the Graphics2D class here but the main problem is that I'm not getting the android equivalent of the whole process that is being performed in the code.


Solution

  • android does not have BufferedImage or Graphics2D as you probably already found out.

    I'm not a java developer (just android) so I'm not 100% sure on what you're trying to achieve, but it seems to me that you're simply creating a copy of the image.

    here a few classes that you'll be using for those type of manipulation: