Lets say this picture below is a full screen custom camera, how could I capture a square photo from the inside of that red square?
I chose this approach on custom camera to avoid THIS kind of problem which results to a squashed preview for square camera. After the process the output should be like this :
I just want to try the solution that Instagram used to prevent that squashed-image-from-square-camera issue, I read it from the accepted answer of #xramos from THIS LINK also.
Here's what he said :
Please help me fellow prgrammers :) Thank you and have a good day :D
Related
I am looking for a sample code/app that can take a picture with the camera and then have the ability to crop it, specifically using the method of moving/zooming the image behind a selector box like the current google photos editor does.
bonus points if you can find something for xamarin :)
i found this, but i am looking for a more complete example.
I come up to you because I have a big problem.
I would like to capture only a portion of the camera view.
I basically want something like this :
I tried to do the same with AndroidStudio, by adding a picture on the screen, here is the result :
It's ugly but it was just to try.
You basically need to put your face into the transparent area, and then click on "take picture". I would like the camera to not take the black part.
How is it possible ? Is it possible to create a kind of mask for the camera ?
I have in mind that in this case, I'll need to take the entire picture and scale it correctly by software. But then, I have to do it differently for every screen sizes. It looks incredibly difficult.
Instead, is it possible to directly modify the cameraView (SurfaceView, or SurfaceHolder) so that I won't need the image, and the picture will automatically fit the "mask" because it's actually the only thing the camera see.
Have you got some clues ?
thank you very much !
The camera sees whatever enters its lens. You cannot "make" it see only a certain shape out of its normal rectangle (unless you tape some black paper over it :)). The cropping is always done after the picture is taken. The SurfaceView and SurfaceHolder are just tools to help you present the picture (which can be already modified, if you want it to) on the phone screen.
No you cannot mask camera capture. You can apply the mask to result. Note that often you get still picture at a resolution much higher than what you use for preview. And preview resolution is not the same as screen resolution (which you should use to put the black mask on the screen). In such case, your postprocessing mask should match the picture resolution and not the preview resolution.
Which are the best ways to create a Camera Custom activity, using FRONT FACE CAMERA or BACK FACE, and choosing the best sizes of SurfaceView and Camera for each device?
I would want to create an activity like Instagram has, squared and with custom layouts above and below.
If there's any sample that's like this, please It would be very useful.
see https://thenewcircle.com/s/post/39/using__the_camera_api (small) or https://github.com/commonsguy/cwac-camera (with lots of enhancements)
you can try my simple library https://github.com/mistreckless/PortraitCameraSupport
but instagram developers did that by another way. They capture the entire screen image then programmatically cut the square preview you see
Thanks in advance for your time!
This has been bothering me for quite some time now. What I want is to display a small .png image on the screen where I tapped my finger, with the camera being active. I don't want any picture to be taken or anything, I only want it to display what the camera sees and on top of that, a small .png file.
I'm trying to make a geographic game where you are able to "shoot" your opponent in the end by seeing through the camera, and tapping him on the screen, to shoot him.
I'm kind of new at this, so the code I made is useless, for anybody, me included :S
Any help or advice is much appreciated:)
To make this effect, first of all you can't use the default Camera App, like this:
Intent intent = new Intent("android.media.action.IMAGE_CAPTURE");
because you can't modify anything on this activity.
And actuary you can write an activity use hardware.camera to take picture.
http://developer.android.com/reference/android/hardware/Camera.html
This will need some knowledge about SurfaceView to show the camera preview and the small .png images, but I'm sure you will find a lot of examples around the Internet.
Pardon the basic question, but I don't quite get how to work with Android Camera class and Parameters.
What I am trying to use Android API to take a picture that will display in a fixed area of my activity. Its about 3inches by 2inches on screen.
Lets say I know that I want a picture that displays in a 360x220px area? I am talking about on the activity size. So I how do I match this up to the accepted picture size of the camera. I mean I see it supports 480x800 and 800x480. This seems to actually be the closest size but its hard to find one thats really matches the display area I have?
So I don't know where to specify that size of picture to take that will look good in that area. Do I specify this during preview? I mean I guess what I thought I could do is preview in same size somehow as the display area I wanted to finally show the picture in? Also how to save it off properly. Should I just pick closest, save and then try to scale? Are there any libraries I should be using for this beside Android SDK?
Sorry about rant. I just have a specific size(I can change it somewhat but I have to fix it and I don't think its 480x800) and I just want to take a picture that will fit in that area, save it load and display it there? How do I do this? I would like a preview that does not take up a bigger area, and a picture that looks just like what is previewed.
Whats happening now is pictures displaying that looked zoomed etc or two small, too big everything but what I want to display.