×

Discussion Board

Results 1 to 4 of 4
  1. #1
    Regular Contributor
    Join Date
    Jan 2006
    Posts
    90

    Image capture in N90

    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

  2. #2
    Super Contributor
    Join Date
    Dec 2005
    Location
    Europe/Poland/Warsaw
    Posts
    1,699

    Re: Image capture in N90

    hi jini,

    #1
    try saving specified size:
    Code:
    byte[] snap = videoControl.getSnapshot("width=640&height=480&encoding=jpeg");
    #2
    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&#2 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

  3. #3
    Regular Contributor
    Join Date
    Jan 2006
    Posts
    90

    Re: Image capture in N90

    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

  4. #4
    Super Contributor
    Join Date
    Dec 2005
    Location
    Europe/Poland/Warsaw
    Posts
    1,699

    Re: Image capture in N90

    hi,
    I don't own n80,
    have you tried saving into internal device memory (fileconn.dir.photos) - was there any difference?
    thanks,
    regards,
    peter

Similar Threads

  1. Opening a JPEG Image
    By ummarbhutta in forum Mobile Java Media (Graphics & Sounds)
    Replies: 8
    Last Post: 2007-02-15, 06:34
  2. how can i capture image with a background image
    By mshouab in forum Mobile Java Media (Graphics & Sounds)
    Replies: 3
    Last Post: 2007-01-23, 16:35
  3. Image capture button in N90
    By jini_1 in forum Mobile Java General
    Replies: 2
    Last Post: 2006-11-16, 23:55
  4. how to cut some part of Image
    By mshouab in forum Mobile Java Media (Graphics & Sounds)
    Replies: 2
    Last Post: 2006-08-04, 09:05
  5. Replies: 1
    Last Post: 2005-10-24, 09:57

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •