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();

MediaStore insert bitmap为黑色的更多相关文章

  1. Android中View转换为Bitmap及getDrawingCache=null的解决方法

    1.前言 Android中经常会遇到把View转换为Bitmap的情形,比如,对整个屏幕视图进行截屏并生成图片:Coverflow中需要把一页一 页的view转换为Bitmap.以便实现复杂的图形效果 ...

  2. Delphi RichEx 图像

    unit RichEx; {2005-03-04 LiChengbinAdded:Insert bitmap or gif into RichEdit controls from source fil ...

  3. 实现Android 版网页快照功能

    现在一般的购物网站,在你完成交易后都会将页面拍照以免日后发生商务纠纷,而对于我们移动开发者这个传统互联网上的优秀经验也同样给了我们一些设计上的启迪,接下来我将几种实现思路写出来供大家参考. 方案一:使 ...

  4. QTP使用技巧

    1QTP基本功能的使用 QTP的基本功能包括两大部分:一部分是提供给初级用户使用的关键字视图:另一部分是提供给熟悉VBScript脚本编写的自动化测试工程师使用的专家视图.但是,并没有严格的区分,在实 ...

  5. 专题:DUILIB Win32 透明效果

    Win32 透明效果相关基础知识 Layered Windows 分层窗口.这是Windows2000开始引入的概念,重新定义了窗口的Hit Testing方法,以前都是把窗口按rectangle的方 ...

  6. 向TRichEdit插入图片的单元

    很简单, 就3个函数, 直接看代码吧 unit RichEditBmp; { 2005-03-04 LiChengbin Added: Insert bitmap or gif into RichEd ...

  7. Golang源码探索(三) GC的实现原理

    Golang从1.5开始引入了三色GC, 经过多次改进, 当前的1.9版本的GC停顿时间已经可以做到极短. 停顿时间的减少意味着"最大响应时间"的缩短, 这也让go更适合编写网络服 ...

  8. Golang源码探索(三) GC的实现原理(转)

    Golang从1.5开始引入了三色GC, 经过多次改进, 当前的1.9版本的GC停顿时间已经可以做到极短.停顿时间的减少意味着"最大响应时间"的缩短, 这也让go更适合编写网络服务 ...

  9. golang----GC的实现原理

    Golang从1.5开始引入了三色GC, 经过多次改进, 当前的1.9版本的GC停顿时间已经可以做到极短.停顿时间的减少意味着"最大响应时间"的缩短, 这也让go更适合编写网络服务 ...

随机推荐

  1. 【tp5】索引数组转成关联数组 ( $a=[],转换成 $a['aa'=>2,'bb'=>'3c'] )

    概念: 索引数组 ==== >>>$arr = []; 关联数组 ====>>> $arr = [ 'orange'=>1,'apple'=>'good ...

  2. ios中NSObject分类(2)

    #import <Foundation/Foundation.h> UIColor * rgb(int r, int g, int b); UIColor * rgbA(int r, in ...

  3. Linux端口命令

    一.开启端口 1.命令行方式 1.开放端口命令: /sbin/iptables -I INPUT -p tcp --dport 8080 -j ACCEPT 2.保存:/etc/rc.d/init.d ...

  4. APP缓存数据线程安全问题

    问题 一般一个 iOS APP 做的事就是:请求数据->保存数据->展示数据,一般用 Sqlite 作为持久存储层,保存从网络拉取的数据,下次读取可以直接从 Sqlite DB 读取.我们 ...

  5. 【DeepLearning】Exercise:Sparse Autoencoder

    Exercise:Sparse Autoencoder 习题的链接:Exercise:Sparse Autoencoder 注意点: 1.训练样本像素值需要归一化. 因为输出层的激活函数是logist ...

  6. Mysql DBA 20天速成教程

    Mysql DBA 20天速成教程 基本知识1.mysql的编译安装2.mysql 第3方存储引擎安装配置方法3.mysql 主流存储引擎(MyISAM/innodb/MEMORY)的特点4.字符串编 ...

  7. ios面试题来一波

    一.如果让你实现属性的weak,如何实现的? PS: @property 等同于在.h文件中声明实例变量的get/set方法, 而其中property有一些关键字,其中就包括weak,atomic的. ...

  8. 基于matplotlib的数据可视化 - 柱状图bar

    柱状图bar 柱状图常用表现形式为: plt.bar(水平坐标数组,高度数组,宽度比例,ec=勾边色,c=填充色,label=图例标签) 注:当高度值为负数时,柱形向下 1 语法 bar(*args, ...

  9. Mapped Statements collection does not contain value for com.xxxx.dao.impl.AreaDAOImpl.findByCode

    org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.exceptions.Persiste ...

  10. SharePoint 2013 How to Backup Site Collection Automatically With a PowerShell Script

    In this post I will introduce a way how to run a script for backing up SharePoint data which could b ...