Display image on Camera perview? - java

Is it possible to display an image in the background of the camera preview? The image be 80% transparent, so don't worry about not seeing the preview. I want to be able to see both the camera preview and the transparent image. I believe this falls into the augmented reality category

This answer is relevant to your interests also this

Related

How can I create a crop box for camera app on an Android device?

iI want to create a app to crop a part of picture exactly after taking a picture in camera app, like this image:
But I don't know how.
First of all you need to configure camera preview with Android Camera(2) API. (example for more details).
Next put your preview surface in FrameLayout and add view over preview surface to draw crop rectangle.
Crop image using, for example, Bitmap.createBitmap(source, left, top, width, height). Read more. (If you configured camera for jpg output you should first decode captured image.)

How to add an image over another image for cropping in java

I am trying to add an image to another image so that I can crop out what I do not want (all the black areas). I have implemented the camera in my app in an android studio and am saving files to my android device. I don't know how to do this.
I have an image view over the camera so that they can get the "shirt" inside the "outline" so it will be easier to crop once I overlay the image and bitmask out all the black. Black Cookie cutter, Original shirt , Both images overlayed, and the final would be just the shirt and nothing else around it as a png so the surroundings are transparent so that I can load it from my specified file directory onto a mannequin like this: Final output.
Any guidance would be helpful. Also sorry I could not embed the pictures as I am new to the site and it only let me post links that are from this website, so they are safe!
To set an overlay over a 'saved' (captured) image, your major concern is that the uncompressed image may get huge. I would use partial images only, and a scaled down version for on-screen preview (if you want to let the user to manually fit the shirt). For the latter task, you can use a png with reduced resolution (even less than 900x1200) and transparency: this way you can use two ImageViews.
If you want to match the shirt overlay on top of a live preview coming from the camera, I recommend to load the shirt in a separate texture, and use OpenGL to display the live texture coming from the camera and the shirt RGBA texture 'above' it. Setup of transparent pixels in this case may be handled in a custom shader.

How to rotate the background image when the device is rotated?

I am trying to get the background image to stop flipping 90° when the device is flipped 90° so I don't have to add the background image to the drawable's again but tilted 90°. As you can see in the illustration below, what's happening is the background image is stretching its width to fit the length of the device.
What's happening is illustration A and C, I would like A and B though.
Just make layout for landscape.
Android.com

Fullscreen camera preview in fragment

I've spent the last two days browsing SO to find answers, unsuccessfully.
I'm trying to reproduce a Snapchat-like app.
What I have so far
A ViewPager composed of 3 fragments.
The middle fragment is supposed to display a camera preview, just like Snapchat, on the whole surface (not truly fullscreen but it should cover the entire UI between the status bar and the bottoms buttons)
I'm able to display either:
The camera preview, with the correct ratio, but not covering its parent View (see picture 1 below)
The camera preview, covering its parent View but stretched (wrong ratio)
 What I need
Avoid stretching the preview. Possibly, the preview would be cropped on both sides (left and right). See picture 2 below. I guess this is what Snapchat does. Or is there any other way?
What I went through
http://www.shakedos.com/2015/Aug/26/writing-an-android-portrait-camera-app.html
Make a SurfaceView larger than the screen (Fitting a camera preview to a SurfaceView larger than the display)
Android full screen camera - while keeping the camera selected ratio : can't find the whole code
Requirements
I need to use the Camera API version 1, not version 2.
Final photos must be taken in 4/3 format, not 16/9.
Portrait is forced although pictures can be in landscape or portrait
Thank you

Fullscreen Rotating Background Image

Developing an app for Android and I'm required to have a fullscreen image rotate (spin around infinitely, pivoted at the centre of the screen) in the background.
I have tried rotating the ImageView using RotateAnimation which works well, except the image is cropped to the size of the parent view.
I have also tried expanding the parent view to a set size (750dp) but it doesn't work well across all the different screen sizes.
Does anyone know of an easy way to implement this, which would involve scaling to uniformly fit the screen size?
Cheers,
Dylan
Screenshot of the image:

Categories

Resources