| Reply | « Previous Thread | Next Thread » |
|
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 |
|
Join Date: Dec 2005
Posts: 1,696
Location: Europe/Poland/Warsaw
Offline
Super Contributor
|
|
hi jini,
#1 try saving specified size: Code:
byte[] snap = videoControl.getSnapshot("width=640&height=480&encoding=jpeg");
remove all other methods (including tone and file creation) test difference, #3 it could be that writing into memory card is slowing down your entire process (testing #1 will let you know where is bottomneck in entire process), So instead of using memory card location try to using internal phone memory using FileConnection property "fileconn.dir.photos" if it is related to location of saved data then it would be the same issue as for early S603rd edition devices and their issues with write I/O operations on memory card, regards, peter |
| peterblazejewicz |
| View Public Profile |
| Find all posts by peterblazejewicz |
|
Hi
i tried #1 and #2. It seems the image capture part (i.e. byte[] snap = videoControl.getSnapshot("width=640&height=480&encoding=jpeg");) 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? jini |
|
Join Date: Dec 2005
Posts: 1,696
Location: Europe/Poland/Warsaw
Offline
Super Contributor
|
|
hi,
I don't own n80, have you tried saving into internal device memory (fileconn.dir.photos) - was there any difference? thanks, regards, peter |
| peterblazejewicz |
| View Public Profile |
| Find all posts by peterblazejewicz |
| Reply | « Previous Thread | Next Thread » |
| Thread Tools | Search this Thread |
|---|---|
| Thread | Thread Starter | Forum | Replies | Last Post |
|---|---|---|---|---|
| Opening a JPEG Image | ummarbhutta | Mobile Java Media (Graphics & Sounds) | 8 | 2007-02-15 07:34 |
| how can i capture image with a background image | mshouab | Mobile Java Media (Graphics & Sounds) | 3 | 2007-01-23 17:35 |
| Image capture button in N90 | jini_1 | Mobile Java General | 2 | 2006-11-17 00:55 |
| how to cut some part of Image | mshouab | Mobile Java Media (Graphics & Sounds) | 2 | 2006-08-04 10:05 |
| How to capture QVGA size bitmap image (CBitmapScaler::Scale() too slow) | i-masa | Symbian Media (Graphics & Sounds) | 1 | 2005-10-24 10:57 |