On Tue, Aug 10, 2010 at 1:27 PM, Pedro Teixeira
<pedroteixeir...@gmail.com> wrote:
> I'm passing a bitmap through a bundle to an activity which I called
> cameraView on which the user has access to the camera of the device.
> I'd like to overlay that bitmap with transparency using the camera as
> the background. Is it possible? to put the bitmap in front of the
> camera?

Put an ImageView in your RelativeLayout, after the SurfaceView, set to
the same dimensions (which are rather strange in your current
implementation). Then, put the bitmap in the ImageView. Later children
in a RelativeLayout stack over top (on the Z axis) of earlier
children, so your ImageView will appear over top of the SurfaceView.

> And how can I change the transparency level?

You can try the under-documented setAlpha() on ImageView. If not, you
may need to modify the bitmap itself, somehow -- that's not my cup of
tea, so I don't have a specific implementation in mind.

Bear in mind that compositing the ImageView and the SurfaceView may
slow down the frame rate of your camera preview.

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com | http://github.com/commonsguy
http://commonsware.com/blog | http://twitter.com/commonsguy

Android Training...At Your Office: http://commonsware.com/training

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