0

is there a way that I can resize the image that has been taken with a zoomed in camera in Xamarin. For eg, if I take image with Zoom factor 2, the image is resized to zoom factor 1 before I save it to gallery. Here is how I am zooming in the camera

var zoom = camera.GetParameters();

        if (zoom.IsZoomSupported)
        {
            if (zoom.Zoom <= 0)
            {
                zoom.Zoom = 8;
                camera.SetParameters(zoom);
            }
        }`
  • What exactly do you mean? Is the saved UIImage showing the full, unzoomed image? I.e. more than what you were seeing in the frame when you snapped the picture? If so, that is odd and I have no idea how to fix, If not then you can get a bitmap and resize it. See SO answer here: https://stackoverflow.com/questions/10413659/how-to-resize-image-in-android – jgoldberger - MSFT Jan 11 '19 at 01:22
  • No, the saved image is exactly what was being displayed on the frame. I want the unzoomed image to be saved into the gallery, but want the frame to be zoomed while taking the image. –  Jan 11 '19 at 01:29
  • If I am understanding correctly, that should be impossible, or requires a totally different approach. If you zoom the camera, then the captured image will be only what was shown when taking the picture. If you want the unzoomed picture, don't zoom the camera, or you can get fancy and create your own camera view where you can zoom just the view that is showing the camera's image, but not zoom the camera itself. – jgoldberger - MSFT Jan 11 '19 at 01:40
  • I have used my own camera view. I think, I have found the solution. The image that is being saved is the textureview.Bitmap of the camera view. I think I will have to resize the textureview to the original size once the image is captured. Does that make sense? –  Jan 11 '19 at 02:03
  • please post your solution as an answer and accept it so this questions gets marked as answered. Helps other searching for questions to help on so they don't waste time on questions that are answered. Thanks! – Leon Jan 31 '19 at 09:04
  • @LeonLu-MSFT I couldn't find the answer for that. I was using depreciated camera api. I used Camer2 Api to solve this. –  Jan 31 '19 at 23:41
  • But what I think answer will be is that you either do not zoom the preview at first and when the textureview is captured, then you can resize the image before displaying it. Or you can capture the image and then resize it. –  Jan 31 '19 at 23:43

0 Answers0