tags:

views:

327

answers:

3

Hi all,

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.

Everything 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:

Thanx Marko

A: 

Hey Marko, I am trying pretty hard to get a camera preview and then save the taken image on a sdcard, but I fail and apperently hardly anybody has some code for 1.5 or higher..... Would you be willing to show us your code? It would be awesome. thanks a lot regards john

john
why not? :) I will post it during the day..cheers
Marko
Here is the code:http://www.androidsnippets.org/snippets/163/cheers :)
Marko
A: 

I have the same Problem did you find a fix ?

Jochem Toolenaar
no, I didn't...so I used intent for camera and that way its much simpler...
Marko
A: 

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
    }
DixieFlatline