Hi everyone,
I am trying to get a picture using with a Java2ME application (model Nokia 6101).
I have managed to get the picture successfully but I need to get rid of the "yes/no" output question of the VideoControl.getSnapshot method, for I need to get the picture remotelly and there will be no one to "push to button".
Is that possible to force "yes" on that output question? If so, can anybody send me any code?
Thanks in advance.
Jonio.
here does the code:
mDisplay = Display.getDisplay(this);
mDisplay.setCurrent(mMainForm);
try {
mPlayer = Manager.createPlayer("capture://video");
mPlayer.realize();
mVideoControl = (VideoControl) mPlayer.getControl("VideoControl");
Canvas canvas = new CameraCanvas(this, mVideoControl);
mDisplay.setCurrent(canvas);
mPlayer.start();
// wait 5 seconds..
Thread.currentThread().sleep(500);
// Get the image.
byte[] raw = mVideoControl.getSnapshot(null);
Image image = Image.createImage(raw, 0, raw.length);
Image thumb = createThumbnail(image);
// Place it in the main form.
if (mMainForm.size()>0 && mMainForm.get(0) instanceof StringItem)
mMainForm.delete(0);
mMainForm.append(thumb);
// Flip back to the main form.
mDisplay.setCurrent(mMainForm);
}
catch (IOException ioe) { handleException(ioe); }
catch (MediaException me) { handleException(me); }
catch (InterruptedException ie) { handleException(ie);}

Reply With Quote



