在用手机相机拍摄的照片上贴上徽标!
我有一个 Android 应用程序,允许用户使用手机摄像头拍照。 此外,我想编辑我拍摄的照片。我不想对其进行复杂的操作,只是一些预定义的东西。图片底部有某种标志!
有人可以指出我正确的方向吗?
I have an android application which allows the user to take a picture using the phone camera.
Further more I want to edit the photo that I've taken.I don't wanna do complicated operations on it, just something predifened.Some kind of logo at the bottom of the picture!!
Can someone point me in the right direction,please?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以使用相机类来拍照。 这里有详细的使用说明:
拍照使用
Camera
类,执行以下步骤:open(int)
获取Camera
的实例。getParameters()
获取现有(默认)设置。setParameters(Camera.Parameters)
。setDisplayOrientation(int)
。setPreviewDisplay(SurfaceHolder)
。如果没有表面,相机将无法启动预览。startPreview()
开始更新预览表面。拍照之前必须先开始预览。takePicture(Camera.ShutterCallback, Camera.PictureCallback, Camera.PictureCallback, Camera.PictureCallback)
来拍摄照片。等待回调提供实际的图像数据。startPreview()
。stopPreview()
停止更新预览表面。onPause()
中立即释放相机(并在onResume()
中重新 open() 相机)。takePicuture
将为您提供一张 jpeg 图像,然后您可以添加水印。为此,请查看带有 alpha 通道的Canvas.drawBitmap
。You can use the camera class to take a picture. There is a detailed explanation on how to use it here:
To take pictures using
Camera
class, do the following steps:Camera
fromopen(int)
.getParameters()
.setParameters(Camera.Parameters)
.setDisplayOrientation(int)
.setPreviewDisplay(SurfaceHolder)
. Without a surface, the camera will be unable to start the preview.startPreview()
to start updating the preview surface. Preview must be started before you can take a picture.takePicture(Camera.ShutterCallback, Camera.PictureCallback, Camera.PictureCallback, Camera.PictureCallback)
to capture a photo. Wait for the callbacks to provide the actual image data.startPreview()
again first.stopPreview()
to stop updating the preview surface.onPause()
(and re-open() it inonResume()
).takePicuture
will give you a jpeg image and then you can add your watermark. For that look intoCanvas.drawBitmap
with alpha channel.