stupid camera.startPreview question

by enervatron » Wed, 27 May 2009 04:19:05 GMT


Sponsored Links
 Hi all,

I'm using the camera for which I've used the CameraPreview example.
All is working just fine --
I'm getting pictures, etc, but when I spin up the SurfaceView  and
startPreview on it (directly
from the example code) the screen is just blank.

Question: shouldn't I be seeing a preview of the view field when I'm
in this mode just like
the system camera app? If so, why would the surfaceview be black/blank?

Mike

--~--~---------~--~----~------------~-------~--~----~



stupid camera.startPreview question

by Max Salley » Wed, 27 May 2009 04:56:19 GMT


 Whatever SurfaceHolder you gave the camera needs to have its type set
to SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS.  This may not be your
problem, but it will cause a blank screen



--~--~---------~--~----~------------~-------~--~----~


Sponsored Links


stupid camera.startPreview question

by enervatron » Wed, 27 May 2009 05:32:45 GMT


 yes, the sample code does this, and hence my code is doing it as well.

Mike





--~--~---------~--~----~------------~-------~--~----~



Other Threads

1. J2ME applications on android device

Dear All

Is it possible to install J2ME applications on andriod device? I read
somewhere that its not possible. are there any alternate ways (such as
third party support) to run J2ME apps on android device.

Best Regards,
android student
--~--~---------~--~----~------------~-------~--~----~

2. change the angle of pixel

Hi all ,
   could someone help me with the below given code snippet.awarning
persists in my application saying that vriable GY is never read . This
warning results in an incorrect output . Could someone help me know if
there is a change in the calculations to be done .


int RY, GY, BY, RYY, GYY, BYY, R, G, B, Y;
        double angle = (3.14159d * (double)deg) / 180.0d;
        int S = (int)(256.0d * Math.sin(angle));
        int C = (int)(256.0d * Math.cos(angle));

        for (int y = 0; y < pich; y++)
        for (int x = 0; x < picw; x++)
            {
            int index = y * picw + x;
            int r = (pix[index] >> 16) & 0xff;
            int g = (pix[index] >> 8) & 0xff;
            int b = pix[index] & 0xff;
            RY = (70 * r - 59 * g - 11 * b) / 100;
            GY = (-30 * r + 41 * g - 11 * b) / 100;
            BY = (-30 * r - 59 * g + 89 * b) / 100;
            Y = (30 * r + 59 * g + 11 * b) / 100;
            RYY = (S * BY + C * RY) / 256;
            BYY = (C * BY - S * RY ) / 256;
            GYY = (-51 * RYY - 19 * BYY) / 100;
            R = Y + RYY;
            R = (R < 0) ? 0 : ((R > 255) ? 255 : R);
            G = Y + GYY;
            G = (G < 0) ? 0 : ((G > 255) ? 255 : G);
            B = Y + BYY;
            B = (B < 0) ? 0 : ((B > 255) ? 255 : B);
            pix[index] = 0xff000000 | (R << 16) | (G << 8) | B;
            }

how can i get rid of the warning GY unread variable
--~--~---------~--~----~------------~-------~--~----~

3. "singleTask" really always at the root of activity stack?

4. Battery Status and Signal Strength Acheivement

5. How to end a application completely?

6. AVD Not starting & no Output

7. Khalid Shaikh is back "developing" Android applications under the name "Sapphire Apps"