我一直在寻找有关向视频添加图像的内容,但我还没有找到我想要的内容.
我想在视频的每一帧中添加位图/图像蒙版(可以录制或从SD中),保留原始声音,并将视频保存到带有图像的SD.
有人知道如何在Android中完成它?
日Thnx
小智 5
创建一个扩展SurfaceView的类
public class PaintSurface extends SurfaceView {
....
在draw()函数中添加代码
@Override
public void draw(Canvas canvas) {
super.draw(canvas);
canvas.drawBitmap(bitmap.img, bitmapPosX, bitmapPosY, null);
}
}
在onCreate函数中创建它的对象.
videoView = new PaintSurface(this);
将其添加到您的布局中
RelativeLayout layut = (RelativeLayout) findViewById(R.id.lay);
layut.addView(videoView);
得到一个持有人
videoHolder = videoView.getHolder();
将此持有者的表面设置为MediaRecorder对象
recorder.setPreviewDisplay(videoHolder.getSurface());
| 归档时间: |
|
| 查看次数: |
2086 次 |
| 最近记录: |