Change camera preview shape in android - android

What I want to do is "simply" get the camera preview (which is already working) and then put it inside a roundish shape for example, so that instead of appearing on a rectangle shape it would appear, on a round one, for example in the top corner.This camera preview is inside a custom view. Also, there is another custom view that runs behind the camera preview, which is a video, as the image: (black -> camera preview, green -> video)
What I want is something like this:
Is this possible?
After searching a while for solutions to this problem I did not come to any conclusion that works.
Thanks in advance

try using corner radius of the shape. it can be useful

Related

Use VRPanoramaView with camera view in background

Is it possible to set camera view as VRPanoramaView background (I use a transparent 360 degrees image) to use as simple augmented reality?
I achieved to set the VrPanoramaView background transparent and placed it in front of the camera preview. That worked. The problem is, that in a transparent panorama picture transparency is always shown black instead of transparent. A GVR collaborator told me today, that transparency is beyond the design of the widgets. So it seems there is no solution to your idea.

Circled camera preview in android

I need to build an app that required a circular camera.
I know there's a way to do that by setting the backgroung rounded but i want to make the camera itself round.
Any ideas?

Android - Make camera preview semi-transparent

I want to make my camera preview see through. I saw this following post:
how to make surfaceview transparent
About making a surface view transparent but the problem is that I am extending surface view for more control over the camera and they say that extending the surface view will make this solution invalid and don't explain why/propose another solution.
What can I do to achieve this?
EDIT:
Yes, I have tried what is in the Linked Post.
THIS IS WHAT I WANT TO ACHIEVE
TOP
=================================
SEMI-TRANSPARENT CAMERA PREVIEW
[FULLSCREEN]
=================================
IMAGES AND TEXT
=================================
BOTTOM
Place another view over your Preview view and make that view semi-transparent. To make view semi-transparent you have to give alpha value with color to the background
ex:
<View
android:background=#88000000/>

Cropping the Android camera

I'm developing an Android app that uses ZBar as a QR code library, and things are going sweet. Now, however, I'm building the interface for the app, and it requires that I show only a certain portion of the camera's feed at the bottom of the screen, something like this:
The camera view below should be full-sized, i.e. a cropped view and not a resized one. However setting the width and height of the FrameLayout has caused it to resize and squash the entire image into the tiny frame.
Is there a way to crop it? I know I could probably place an overlay over the original image, but how does one create a transparent square in the middle to display what I need?Besides, the QR reader would catch anything the camera captures, so if the user brought the QR code in front of the camera and it captured it "off screen" (by the part that's actually covered by the overlay), it would be extremely confusing.
So I guess what I'm saying is, I can't use an overlay to "crop" the picture. Is there any other way to do it?
As far my knowledge one cannot crop camera view but what you can do is re-size the frame and then capture the image.
Still i would suggest to refer this post
The first thought that comes to mind is to put your CameraPreview in a view inside a FrameLayout. Then add more views on top of the CameraPreview view to hide the parts that you do not want to be visible.
Or Perhaps just one view super-imposing the camera preview view with a PNG which covers everything with "cropped" area set as transparent.

set up different clickable part image android

Im working with android about image and onclick listener. The purpose of my app is to monitor the area that user clicks on the screen. For example, I have a picture containing a rectangular and a circle. Assume that the color of the whole picture is brown(wood). So when I click on the rectangular, the color of rectangle will change to yellow. When I click on the one part of the picture, the color of that part will change its color, but other parts do not change. So, Im thinking about the solution for this app. Do I have to cut this picture separately and put them into the screen by using relative review? Or is there any other way to do this(Set up a coordination system)?
Yes you have to cut this picture separately and put them into the screen by using relative review. For example two ImageView with your backgound.
You can slse the image as recommeded by the other post, or overlay the image with a RelitiveLayout with specific sized buttons (background = #android/color/transparent)

Categories

Resources