图片文件转为Bitmap对象
String filePath="c:/01.jpg";

 Bitmap bitmap=BitmapFactory.decodeFile(filePath);

//将图片的长和宽缩小味原来的1/2

private Options getBitmapOption(int inSampleSize)

Bitmap对象保存味图片文件
public void saveBitmapFile(Bitmap bitmap)

//将要保存图片的路径
            try

    {
                    BufferedOutputStream bos = new BufferedOutputStream(new FileOutputStream(file));
                    bitmap.compress(Bitmap.CompressFormat.JPEG, 100, bos);
                    bos.flush();
                    bos.close();
            }

    catch (IOException e)

    {
                    e.printStackTrace();
            }
}

相关文章:

  • 2022-12-23
  • 2022-01-19
  • 2021-06-11
  • 2022-12-23
  • 2022-12-23
  • 2022-02-03
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-07-27
  • 2022-12-23
  • 2021-11-06
  • 2021-12-17
  • 2022-12-23
相关资源
相似解决方案