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.
Related
I'm trying to make a page of cropping profile picture. I have a crop frame which you can drag along. The image is transparent, or blurred, but within the frame, it is clear. The area within the frame will be your profile picture. I know how to set alpha, but I haven't come up with a way to set alpha within the crop frame. So this is the effect I want:
Any help would be great. Thanks!
You should probably think about having two ImageViews. One rectangular for the blurred photo and one circular placed on top of the first one for the crop preview.
When user selects a photo, you would create the blurred copy. It seems you already know how to move the photo within the ImageWiew, and so doing couple of calculations with the widths and heights of the ImageViews and the photo, should give you the correct positioning of the photos in both of the ImageViews to make them align.
Lastly when dragging on either of the ImageViews, adjust the position of the photo in both ImageViews.
This looks promising for circular ImageViews
ImageView in circular through xml
This might have something for efficient image blurring How to blur background images in Android
If you want a different approach, using OpenGL ES, you might be able to achieve realtime blurring outside of the circle with a pixel shader Shader for Android OpenGL ES. Possibly a more elegant solution, but probably not as simple.
I'm not exactly sure if you want blurring or transparency, but the solution will be very similar.
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
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?
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/>
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.