views:

17

answers:

1

I'm trying to ascertain wither there is a limitation on the camera access in the j2me implementation on the HTC Touch2. The native camera is 3MP however it seams that the quality is notably reduced when accessed via j2me, in fact it seams that the only size and format the .getSnapshot() method is able to return is a 240x320 pixel jpeg. I'm trying to confirm that this is a limitation if the j2me implementation and not my coding. Hears and example of some of the things I have tried:

private void showCamera() {

    try {



        mPlayer = Manager.createPlayer("capture://video");



//      mPlayer = Manager.createPlayer("capture://video&encoding=rgb565&width=640&height=480");



        mPlayer.realize();



        mVideoControl = (VideoControl)mPlayer.getControl("VideoControl");



        canvas = new CameraCanvas(this, mVideoControl);

        canvas.addCommand(mBackCommand);

        canvas.addCommand(mCaptureCommand);

        canvas.setCommandListener(this);

        mDisplay.setCurrent(canvas);



        mPlayer.start();

    }

    catch (Exception ex) {}

}



public void capture() {

    try {

        // Get the image.

        byte[] raw = mVideoControl.getSnapshot("encoding=jpeg&quality=100&width=640&height=480");

 //         byte[] raw = mVideoControl.getSnapshot("encoding=png&quality=100&width=

//                      640&height=480");



//      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(image);

If anyone could help it would be much appreciated.

A: 

I have reseved word from a number of sources that there is indeed a limitation on the camera access the JVM has witch is put in place by the operating system.

Steven Knox