开发者

Image Size With J2ME on an HTC Touch2

开发者 https://www.devze.com 2023-01-03 11:20 出处:网络
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 w

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(mCaptureCo开发者_运维知识库mmand);

        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.


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号