zoukankan      html  css  js  c++  java
  • MediaStore insert bitmap为黑色

    MediaStore.Images.Media.insertImage(mFragmentActivity.getContentResolver(), qrBitmap, "xx券面值10元", "我是小钱生成");
    mFragmentActivity.sendBroadcast(new Intent(Intent.ACTION_MEDIA_MOUNTED, Uri.parse("file://"+ Environment.getExternalStorageDirectory())));

    保存的图片是黑色的,不知道为嘛。

    private void saveImage(final Bitmap bitmap) {
    new Thread(new Runnable() {
    @Override
    public void run() {
    try {
    FileOutputStream m_fileOutPutStream = new FileOutputStream(
    "/mnt/sdcard/DCIM/Camera" + File.separator + "filesave.png");
    bitmap.compress(CompressFormat.PNG, 100, m_fileOutPutStream);
    m_fileOutPutStream.flush();
    m_fileOutPutStream.close();
    System.out.println("保存完成");
    } catch (Exception e) {
    e.printStackTrace();
    }
    }
    }).start();

  • 相关阅读:
    Docker大会的新福利:LinuxKit 和 Moby 开源项目
    NS3
    (OK) NS3
    MPTCP
    Utilizing multi-core processors in NS-2
    (OK) Fedora 24
    error compiling gcc: undefined reference to libc_name_p
    gccxml
    NS3
    NS3
  • 原文地址:https://www.cnblogs.com/anee/p/3628904.html
Copyright © 2011-2022 走看看