Hi
i'm trying to capture image in N90. It's taking more than 30 seconds to capture and save the image for the first time. And after that it is taking around 15 seconds only. The problem is if i focus on an item and click capture and if i change the focus before saving, some other picture is getting saved. How can i capture the focussed picture itself.
the code is as follows:
private void doSnapshot() {
removeCommand(captureCmd);
removeCommand(backCmd);
new Thread() {
public void run() {
try {
byte[] snap = videoControl.getSnapshot("encoding=jpeg");
try {
Manager.playTone(40, 50, 50);
} catch (Exception ignore) {
//couldn't play sound
}
player.stop();
Alert al = new Alert("", "", null, AlertType.INFO);
al.setString("Saving...");
midlet.getDisplay().setCurrent(al);
createFolder("file:///E:/Test/");
// player.stop();
if (snap != null) {
Image im = Image.createImage(snap, 0, snap.length);
String name = getFileNameForMedia("photo",
EventConstants.IMG_EXT);
try {
createFile(midlet
.getAppProperty("ReportLocation")
+ name);
OutputStream out = fcFile.openOutputStream();
out.write(snap);
try {
out.close();
connecionClose();
} catch (Exception ignore) {
}
try {
al.setString("Photo saved as " + name);
al.setImage(ReportCanvas.createThumbnail(im,
40, 40));
al.setTimeout(3000);
midlet.getDisplay().setCurrent(al);
} catch (Exception e) {
}
addCommand(captureCmd);
addCommand(backCmd);
player.start();
} catch (Exception e) {
AlertScreen.showMessage("Error in saving image");
addCommand(captureCmd);
addCommand(backCmd);
}
}
} catch (MediaException me) {
AlertScreen.showMessage("Photo not saved.");
addCommand(backCmd);
addCommand(captureCmd);
} catch (SecurityException se) {
midlet.mainMenuCanvas
.displaySecurityAlert("To use application features, please allow to use camera.");
} catch (Exception e) {
addCommand(backCmd);
addCommand(captureCmd);
}
}
}.start();
}
jini

Reply With Quote
is taking time. When i tried with #1 and #2, the image capture part is taking more than 30 sec first time only(after starting the app). After that it's taking around 5 sec only. What can i specify to speed up the getSnapShot method? 

