Android : Xlabs Camera, create thumbnail for Android

on Tuesday, March 24, 2015


In my PCL im using Xlabs code for taking a picture:



public async Task<MediaFile> TakePicture()
{
Setup ();

ImageSource = null;

return await _Mediapicker.TakePhotoAsync (new CameraMediaStorageOptions {
DefaultCamera = CameraDevice.Front, MaxPixelDimension = 400
}).ContinueWith (t => {
if (t.IsFaulted)
{
Status = t.Exception.InnerException.ToString();
}
else if (t.IsCanceled)
{
Status = "Canceled";
}
else
{
var mediaFile = t.Result;
ImageSource = ImageSource.FromStream(() => mediaFile.Source);

return mediaFile;
}

return null;
}, _scheduler);
}


This works fine and the image gets stored on the devices disc. What I would like to do is to create a smaller, thumbnail-version of the image that i can store in my SQliteDB.


Maybe I have a class like this:



public class user
{
public int Id { get; set; }
public TYPE?? TheThumbnail { get; set; }
public string Name { get; set; }
}


I appreciate the help, thank you


0 comments:

Post a Comment