hi,
i am new to android & facing some issues in transparency.
My intention is to
1)in my test activity i have a text "hello world"
2)my test activity intern call Preview of camera code.
when this is happened, i am not able to see the below "hello world"
how can i make that visible?
i also want to create a new text(or might be a bitmap also) and
displayed on the top view. so when my program runs it should show two
different texts in two different layers(not sure if the terminology is
proper).I am trying this experiment in SDK not in actual h/w.
here is my code.
Any help will be great.
Thanks.
==================
public class test extends Activity {
    /** Called when the activity is first created. */
        private Preview mPreview;
        @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        TextView text = (TextView)findViewById(R.id.TextView01);//
textview01 contains "hello world"
        text.setTextColor(Color.WHITE);
        getWindow().setFlags(WindowManager.LayoutParams.ALPHA_CHANGED,
                WindowManager.LayoutParams.ALPHA_CHANGED);

        // Create our Preview view and set it as the content of our
activity.
        mPreview = new Preview(this);
        setContentView(mPreview);
    }
}
-----------------------
--------------------------
class Preview extends SurfaceView implements SurfaceHolder.Callback {
    SurfaceHolder mHolder;
    Camera mCamera;

    Preview(Context context) {
        super(context);

        // Install a SurfaceHolder.Callback so we get notified when
the
        // underlying surface is created and destroyed.
        mHolder = getHolder();
        mHolder.addCallback(this);
        mHolder.setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS);

    }

    public void surfaceCreated(SurfaceHolder holder) {
        // The Surface has been created, acquire the camera and tell
it where
        // to draw.


        mCamera = Camera.open();


        mCamera.setPreviewDisplay(holder);
    }

    public void surfaceDestroyed(SurfaceHolder holder) {
        // Surface will be destroyed when we return, so stop the
preview.
        // Because the CameraDevice object is not a shared resource,
it's very
        // important to release it when the activity is paused.

        mCamera.stopPreview();
        mCamera = null;
    }

    public void surfaceChanged(SurfaceHolder holder, int format, int
w, int h) {
        // Now that the size is known, set up the camera parameters
and begin
        // the preview.

        Camera.Parameters parameters = mCamera.getParameters();
        parameters.setPreviewSize(w, h);
        mCamera.setParameters(parameters);
        mCamera.startPreview();

    }


}

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to