×

Discussion Board

Results 1 to 6 of 6
  1. #1
    Registered User
    Join Date
    Sep 2009
    Location
    Bangalore, India
    Posts
    49

    Post J2ME Camera Problem..

    Hi All,
    I have a program where camera option is implemented .. Here the default resolution is 160 X 120..
    Can i customize that... ???

    I have used..
    byte[ ] photo = videoControl.getSnapshot(null);

    Instead if i use

    videoControl.getSnapshot("encoding=jpeg&quality=100&width=2048&height=1536");
    It neither takes the snapshot nor it gives any exception..
    Any solution.. ? I need at lease 320 X 240 resolution....
    Regards
    Nilanchala

  2. #2
    Registered User
    Join Date
    Oct 2009
    Location
    Noida
    Posts
    941

    Re: J2ME Camera Problem..

    Just try - videoControl.getSnapshot("encoding=png&width=240&height=320");

    or

    VideoControl.getSnapshot("width=240&height=320")


    Which device you are trying it on ?


    Also - no need to Post the entire Question in Bold on this Discussion Board.
    Last edited by ektasrv; 2010-06-21 at 06:44.
    Thanks,
    Ekta

  3. #3
    Super Contributor
    Join Date
    Sep 2008
    Location
    Noida, U.P.
    Posts
    1,330

    Re: J2ME Camera Problem..

    Quote Originally Posted by ektasrv View Post
    Also - no need to Post the entire Question in Bold on this Discussion Board.
    Please write any statement in requested form not in ordered way.

    Also its not mandatory that whatever the encoding passed as param will get positive results..It depends on device to device.
    thanks,
    jitu_goldie..

    KEEP TRYING..

  4. #4
    Registered User
    Join Date
    Oct 2009
    Location
    Noida
    Posts
    941

    Re: J2ME Camera Problem..

    Quote Originally Posted by jitu_goldie View Post
    Please write any statement in requested form not in ordered way.

    Also its not mandatory that whatever the encoding passed as param will get positive results..It depends on device to device.
    Sorry - if my tone -- looked to be ordering... I just wanted to tell Nilanchala that its not needed - no offense intended! Sorry again.

    And yes - as Jitu wrote -- its not mandatory that specified encoding is returned by getSnapshot(), as it depends on device capabilities too.
    Thanks,
    Ekta

  5. #5
    Registered User
    Join Date
    Sep 2009
    Location
    Bangalore, India
    Posts
    49

    Re: J2ME Camera Problem..

    Quote Originally Posted by ektasrv View Post
    Sorry - if my tone -- looked to be ordering... I just wanted to tell Nilanchala that its not needed - no offense intended! Sorry again.

    And yes - as Jitu wrote -- its not mandatory that specified encoding is returned by getSnapshot(), as it depends on device capabilities too.
    It works fine with the device... I was testing in emulator that time.. Anyways thanks..

    One more thing in my code it have lil problem..
    After i take snapshot it shows me the snap for few time and then again it start the video player even though i have stoped the video controller..
    my code is :

    public void run() {
    takeSnap();
    }

    public void takeSnap() {
    try {
    byte[] photo = videoControl.getSnapshot("encoding=png&width=240&height=320");
    snapshot = Image.createImage(photo, 0, photo.length);

    this.removeCommand(cmdCapture);
    this.removeCommand(cmdBack);
    this.addCommand(cmdUse);
    this.addCommand(cmdDiscard);

    player.close();
    if (player != null) {
    player = null;
    }
    cameraThread = null;
    if (videoControl != null) {
    videoControl = null;
    }

    } catch (Exception me) {
    }
    }

    Please suggest me if any mistaike in my code..
    Regards
    Nilanchala

  6. #6
    Registered User
    Join Date
    Oct 2009
    Location
    Noida
    Posts
    941

    Re: J2ME Camera Problem..

    Looks to be some threading issue.
    Try to set the Visibility of VideoControl to false.

    VideoControl.setVisible(false);

    and player.deallocate();

    Ref to this example -- http://wiki.forum.nokia.com/index.ph...ots_in_Java_ME
    or WTK Camera capture example.
    Thanks,
    Ekta

Similar Threads

  1. Problem Regarding getting the Keycodes and Disabling the Camera in j2me
    By talk2mishal in forum General Development Questions
    Replies: 1
    Last Post: 2008-08-31, 20:14
  2. Replies: 2
    Last Post: 2006-05-02, 07:19
  3. Camera Application in j2me
    By bhaveshk in forum Mobile Java Media (Graphics & Sounds)
    Replies: 2
    Last Post: 2006-03-06, 15:06
  4. camera application in j2me
    By bhaveshk in forum Mobile Java General
    Replies: 1
    Last Post: 2006-02-21, 01:36
  5. Camera API In J2ME
    By soumyapr in forum Mobile Java Media (Graphics & Sounds)
    Replies: 1
    Last Post: 2005-11-21, 13:04

Posting Permissions

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