Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 58056

how size image, problem to display

$
0
0

Hello,
I 'can not display an image: width = height> 2048.
In my application, I take a picture with the photo appliance.
To wait the camera, I use the method:

var mediaPicker = DependencyService.Get<IMediaPicker>();
                var result = await mediaPicker.TakePhotoAsync(new CameraMediaStorageOptions { DefaultCamera = CameraDevice.Rear, MaxPixelDimension = 10}).ContinueWith(t =>
                {
                    if (t.IsFaulted)
                    {
                        var s = t.Exception.InnerException.ToString();
                    }
                    else if (t.IsCanceled)
                    {
                        var canceled = true;
                    }
                    else
                    {
                        var mediaFile = t.Result;
                        mediaFile.Exif.ThumbnailData = new byte[2400];
                        ImageSource = ImageSource.FromStream(() => mediaFile.Source);
                        var mediaType = t.Result;
                        MemoryStream mstr = new MemoryStream();
                        mediaType.Source.CopyTo(mstr);
                        _mediaFile = mediaFile;
                        _photoTook = true;
                        return mediaFile;
                    }
                    return null;
                }, _scheduler);

When I display too large image, the log error is :

09-18 17:41:50.268 W/OpenGLRenderer(10735): Bitmap too large to be uploaded into a texture (2448x3264, max=2048x2048)
09-18 17:41:50.295 W/OpenGLRenderer(10735): Bitmap too large to be uploaded into a texture (2448x3264, max=2048x2048)
09-18 17:41:50.306 D/ActivityThread(10735): ACT-DESTROY_ACTIVITY handled : 1 / android.os.BinderProxy@417e6d60
09-18 17:41:50.956 W/OpenGLRenderer(10735): Bitmap too large to be uploaded into a texture (2448x3264, max=2048x2048)
09-18 17:41:50.972 W/OpenGLRenderer(10735): Bitmap too large to be uploaded into a texture (2448x3264, max=2048x2048)
09-18 17:41:50.989 W/OpenGLRenderer(10735): Bitmap too large to be uploaded into a texture (2448x3264, max=2048x2048)
09-18 17:41:51.004 W/OpenGLRenderer(10735): Bitmap too large to be uploaded into a texture (2448x3264, max=2048x2048)
09-18 17:41:51.005 I/SurfaceTextureClient(10735): [0x58884818] frames:13, duration:1.002000, fps:12.963190
09-18 17:41:51.020 W/OpenGLRenderer(10735): Bitmap too large to be uploaded into a texture (2448x3264, max=2048x2048)
09-18 17:41:51.039 W/OpenGLRenderer(10735): Bitmap too large to be uploaded into a texture (2448x3264, max=2048x2048)
09-18 17:41:51.054 W/OpenGLRenderer(10735): Bitmap too large to be uploaded into a texture (2448x3264, max=2048x2048)
09-18 17:41:51.073 W/OpenGLRenderer(10735): Bitmap too large to be uploaded into a texture (2448x3264, max=2048x2048)
09-18 17:41:51.087 W/OpenGLRenderer(10735): Bitmap too large to be uploaded into a texture (2448x3264, max=2048x2048)
09-18 17:41:51.104 W/OpenGLRenderer(10735): Bitmap too large to be uploaded into a texture (2448x3264, max=2048x2048)
09-18 17:41:51.121 W/OpenGLRenderer(10735): Bitmap too large to be uploaded into a texture (2448x3264, max=2048x2048)
09-18 17:41:51.143 W/OpenGLRenderer(10735): Bitmap too large to be uploaded into a texture (2448x3264, max=2048x2048)
09-18 17:41:51.154 W/OpenGLRenderer(10735): Bitmap too large to be uploaded into a texture (2448x3264, max=2048x2048)
09-18 17:41:51.178 W/OpenGLRenderer(10735): Bitmap too large to be uploaded into a texture (2448x3264, max=2048x2048)
09-18 17:41:51.188 W/OpenGLRenderer(10735): Bitmap too large to be uploaded into a texture (2448x3264, max=2048x2048)
09-18 17:41:51.205 W/OpenGLRenderer(10735): Bitmap too large to be uploaded into a texture (2448x3264, max=2048x2048)
09-18 17:41:51.220 W/OpenGLRenderer(10735): Bitmap too large to be uploaded into a texture (2448x3264, max=2048x2048)

thank you for your response.


Viewing all articles
Browse latest Browse all 58056

Trending Articles