×

Discussion Board

Results 1 to 7 of 7
  1. #1
    Registered User
    Join Date
    Aug 2010
    Location
    Gurgaon, Haryana
    Posts
    62

    Arrow Changing resolution of snapshot taken

    Hi,
    I am developing a camera application which I want to run on Nokia 3110 also, a 3rd edition phone. When I call getSnapshot() method of VideoControl class it only works with the 'null' parameter and gives 120x160 default resolution in the obtained image. But I want to change the resolution to 480x640 and others. For that when I used "encoding=image/png&width=480&height=640" it throws a null pointer exception. Does anyone has any idea where am I going wrong and how to obtain a different resolution than 120x160 ?

    Please help!!!

  2. #2
    Super Contributor
    Join Date
    May 2008
    Location
    Helsinki, Finland
    Posts
    1,100

    Re: Changing resolution of snapshot taken

    Hi cryptyritu,

    There is some information here and links within that may help you to go on:

    http://stackoverflow.com/questions/2...access-in-j2me

    It handles a similar case.

    Best Regards,
    [FONT="Comic Sans MS"][COLOR="Blue"][/COLOR][I]Marko Lumivuori
    Technical Support
    +358 40 8019330
    [email]marko.lumivuori@nokia.com[/email][/I][/FONT]

  3. #3
    Registered User
    Join Date
    Aug 2010
    Location
    Gurgaon, Haryana
    Posts
    62

    Re: Changing resolution of snapshot taken

    Hi Maveric,
    Thanks for the link But I had already gone through that post. May be I have not mentioned properly, but I have used that line of code videoControl.getSnapshot("encoding=png&width=240&height=320"); in my source code. When I run it in my emulator and on phone it gives an alert "Application error" and "Null pointer exception" . And when I use videoControl.getSnapshot(null); then application runs properly.

    Please help!
    Thanks,

  4. #4
    Registered User
    Join Date
    Jan 2009
    Location
    Bangalore, India
    Posts
    116

    Re: Changing resolution of snapshot taken

    Ritu,

    When you pass null to getSnapshot method, it means it will return png image and its default resolution is 120x160 in most of the cases.

    Resolution can be changed programmatically but for other image types and up to certain limit to which a camera can handle. It may vary devices to device.

    I have doubt on the below code which you are using as an argument to getSnapshot method –
    getSnapshot(“encoding=image/png&width=480&height=640”);

    Above code may cause the problem because you are setting image type as png to which default resolution is 120x160 and I think it can’t be changed.

    If your device support jpg images (I think it should support), try using the below code –

    getSnapshot("encoding=image/jpg&width=480&height=640");

    I think it should work in your case and should handle the given resolution.

    To know the supported image types by your device use the below code –

    String imgTypes = System.getProperty("video.snapshot.encodings");
    System.out.println("imgae types = " +imgTypes);


    Thanks,
    Somendra Singh

  5. #5
    Registered User
    Join Date
    Aug 2010
    Location
    Gurgaon, Haryana
    Posts
    62

    Re: Changing resolution of snapshot taken

    Hi Somendra,
    Indeed we cannot change png format resolution in Nokia 3110. But we can change for jpeg images upto 480x640 (excluding). After that it gives "Out of Memory exception". Thanks a lot for the solution.
    Cheers!
    Ritu Raj

  6. #6
    Registered User
    Join Date
    Jan 2009
    Location
    Bangalore, India
    Posts
    116

    Re: Changing resolution of snapshot taken

    Out of Memory exception is due to the shortage of the heap memory (runtime memory) in you device. As you must be creating the image from the image byte array returned by the getSnapshot method with the resolution as you stated. Image.CreateImage consumes plenty of heap memory and in your case the device in question is unable to handle this much of memory in run time hence out of memory exception.

    Regards,
    Somendra

  7. #7
    Registered User
    Join Date
    Aug 2010
    Location
    Gurgaon, Haryana
    Posts
    62

    Re: Changing resolution of snapshot taken

    Okay,
    thanks for the info Somendra.

    Regards,
    Ritu Raj

Similar Threads

  1. Changing resolution for CCamera
    By schrecklichkeit in forum Symbian Media (Closed)
    Replies: 4
    Last Post: 2009-11-19, 06:15
  2. Changing Camera Resolution
    By aml_1989 in forum Symbian Media (Closed)
    Replies: 4
    Last Post: 2008-06-24, 08:26
  3. changing video resolution
    By domdare in forum Streaming and Video
    Replies: 3
    Last Post: 2008-02-15, 10:09
  4. Maximum snapshot resolution
    By matbal in forum Mobile Java Media (Graphics & Sounds)
    Replies: 1
    Last Post: 2008-02-08, 07:41
  5. Changing ringtones by changing profile programatically
    By daredevilWin in forum Symbian Media (Closed)
    Replies: 0
    Last Post: 2005-05-24, 07:59

Posting Permissions

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