开发者

camera preview on android - strange lines on 1.5 version of sdk

开发者 https://www.devze.com 2022-12-16 18:26 出处:网络
I am developing the camera module for an android application. In main application when user clicks on \'take picture\' button, new view with SurfaceView control is opened and camera preview is shown.

I am developing the camera module for an android application. In main application when user clicks on 'take picture' button, new view with SurfaceView control is opened and camera preview is shown. When users click on dpad center, camera takes picture and save it to the disc. Pretty simple and straightforward.

Everyth开发者_开发知识库ing works fine on my device - HTC Tattoo, minsdkversion 1.6

...but when I tested application on HTC Hero minsdkversion 1.5, when camera preview is shown,some strange lines occur.

Anyone has idea what is going on?

p.s. altough preview is crashed, taking of pictures works fine

here is the picturealt text http://img163.imageshack.us/img163/4088/camerademo.jpg:

Thanx Marko


Apparently this is hero bug, in function surfaceChanged switch width and height parameters:

    if (getResources().getConfiguration().orientation == Configuration.ORIENTATION_PORTRAIT) 
    { 
        parameters.setPreviewSize(h, w); //instead of w,h
    }
0

精彩评论

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

关注公众号