2
我正在做視頻錄製和保存記錄在我的文件夾內sdcard ..現在當我播放視頻從SD卡我想添加日期和時間在視頻視圖中,我完成圖像意味着能夠 使用幀佈局和Z-index在圖像視圖中添加時間戳記,但如何使用視頻錄製完成..是否有可能?如果有,請提出任何方式.. 我對圖片添加時間戳代碼給出以下refrence URL ...:是否有可能在錄製的視頻添加時間戳:android
現在如何爲視頻做同樣的事?
任何幫助將在這裏被大大apprciated ...
Bitmap src = BitmapFactory.decodeResource(getResources(), R.drawable.splashmodified); // the original file is cuty.jpg i added in resources
Bitmap dest = Bitmap.createBitmap(src.getWidth(), src.getHeight(), Bitmap.Config.ARGB_8888);
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
String dateTime = sdf.format(Calendar.getInstance().getTime()); // reading local time in the system
Canvas cs = new Canvas(dest);
Paint tPaint = new Paint();
tPaint.setTextSize(35);
tPaint.setColor(Color.BLUE);
tPaint.setStyle(Style.FILL);
cs.drawBitmap(src, 0f, 0f, null);
float height = tPaint.measureText("yY");
cs.drawText(dateTime, 20f, height+15f, tPaint);
try {
dest.compress(Bitmap.CompressFormat.JPEG, 100, new FileOutputStream(new File("/sdcard/timeStampedImage.jpg")));
} catch (FileNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}