我的手机中有一个代码,它可以拍照并将其保存到存储单元中。
我想添加功能以保存图片中包含拍摄日期的图像。
byte[] capturedImageData = videoControl.getSnapshot("encoding=jpeg&width=2000&height=1500");
String dirPhotos = "file:///e:/";
m_suministro = TxtSuministro.getString();
NombreFoto = m_suministro + "-" + ContadorFotos + ".jpg";
String fileName = dirPhotos + NombreFoto;
file = (FileConnection) Connector.open(fileName, Connector.READ_WRITE);
// If there is no file then create it
if (file.exists() == false) {
file.create();
ContadorFotos++;
}
// Write data received from camera while making snapshot to file
outStream = file.openOutputStream();
outStream.write(capturedImageData);
带有日期 tnx的示例图像