如何使当前日期的单一形象作为android系统中的文字和相机拍摄图像 [英] How to make a single image of Current date as text and Camera Captured Image in android

查看:116
本文介绍了如何使当前日期的单一形象作为android系统中的文字和相机拍摄图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发Android应用程序。
我的意图是使用设备的相机拍摄图像,并添加当前的日期和时间作为捕获到的图像上的文字。并作出单一的形象整个事情对服务器上传。
任何一个可以分享您的想法和帮助我。

I am working on Android application development. My intention is to capture an image using device camera and add the current date and time as text on the captured image. and make the entire thing as single image to upload on server. Can any one share your thoughts and help me out .

先谢谢了。

推荐答案

读<一个href=\"http://stackoverflow.com/questions/5991319/capture-image-from-camera-and-display-in-activity\">here

编辑:

Bitmap photo = (Bitmap) data.getExtras().get("data"); 
//create bitmap with a canvas
Bitmap newPhoto = Bitmap.createBitmap(photo.getWidth(),photo.getHeight());
Canvas canvas = new Canvas(newPhoto);
canvas.drawBitmap(photo,0,0,null);
//draw the text
Paint paint = new Paint();
//paint.setColor(Color.BLACK);
canvas.drawText("write bla bla bla",x,y,paint);
ByteArrayOutputStream stream = new ByteArrayOutputStream();
newPhoto.compress(Bitmap.CompressFormat.PNG, 100, stream);
//get bytes from stream and send to your server

这篇关于如何使当前日期的单一形象作为android系统中的文字和相机拍摄图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆