Shimingli / WritingPen

:wink:2018.2.7完成了田字格的Demo,画笔效果的实现(目前仅仅实现了两种的功能:钢笔和水彩笔,同时提供了清除画布的功能)

Home Page:http://www.jianshu.com/p/3ee259f2caf7

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

完成回调

Vicent9920 opened this issue · comments

老哥,请教一个问题:在签字结束的时候,回调应该拿 Bitmap 还是签名数据?如果结束的时候保存Bitmap,那么怎么获取 HandRichTextEditor 内的Bitmap呢?(删除的时候没有按顺序,看了半天没有理清楚);如果结束的时候保存签名也会有删除的时候如何删除对应的 WordSandPictures,以及WordSandPictures 如何转为 Bitmap 的问题?

恳请老哥指点,谢谢!

HandRichTextEditor 其实是个ScrollView 然后 把 ScrollView生成一张图片 即可 这个应该不难 其实

public static Bitmap shotScrollView(ScrollView scrollView,String picpath) {
int h = 0;
Bitmap bitmap = null;
for (int i = 0; i < scrollView.getChildCount(); i++) {
h += scrollView.getChildAt(i).getHeight();
}
bitmap = Bitmap.createBitmap(scrollView.getWidth(), h, Bitmap.Config.RGB_565);
final Canvas canvas = new Canvas(bitmap);
scrollView.draw(canvas);
// 测试输出
FileOutputStream out = null;
try {
out = new FileOutputStream(picpath);
} catch (FileNotFoundException e) {
e.printStackTrace();
}
try {
if (null != out) {
bitmap.compress(Bitmap.CompressFormat.PNG, 100, out);
out.flush();
out.close();
}
} catch (IOException e) {
}
return bitmap;

不好意思 最近有点忙 ,现在才看