BufferedImage in Android

前端 未结 3 990
既然无缘
既然无缘 2020-11-29 12:04

I\'ve an app that takes a camera picture and saves on sdcard as jpeg. i want to distort the picture with a spherize filter. I can read the jpeg to a bitmap, but the code i h

相关标签:
3条回答
  • 2020-11-29 12:27

    No. You can't use BufferedImage because, like you said, javax.imageio isn't in the Android SDK. The Bitmap class, however, does support getting individual pixels using the getPixel() and getPixels() methods so you should be able to use those to do any type of image transform you want to do.

    0 讨论(0)
  • 2020-11-29 12:27

    BufferedImage is part of AWT, which is not implemented in Java. You need to find Android replacements for what you're trying to do.

    Read this:

    http://developer.android.com/guide/topics/graphics/index.html

    0 讨论(0)
  • 2020-11-29 12:30

    You can use Bitmap instead of bufferedimage but this won't resolve your problem since you need make changes on TransformFilter because this code eventually call the super.filter( src, dst ); which is making the actual job. If your only goal is to implement spherize filter, this link provides a direct algorithm for spherize filter which would be easier to port to Android.

    0 讨论(0)
提交回复
热议问题