I use a canvas that has a set width and height. It is 500x500 big and I also want to save it as such with this method:
private async void SaveasGIF(object sender, RoutedEventArgs e)
{
var savePicker = new Windows.Storage.Pickers.FileSavePicker();
savePicker.SuggestedStartLocation = Windows.Storage.Pickers.PickerLocationId.PicturesLibrary;
savePicker.FileTypeChoices.Add("Gif with embedded ISF", new[] { ".gif" });
Windows.Storage.StorageFile file = await savePicker.PickSaveFileAsync();
if (null != file)
{
try
{
using (Windows.Storage.Streams.IRandomAccessStream stream = await file.OpenAsync(Windows.Storage.FileAccessMode.ReadWrite))
{
// Truncate any existing stream in case the new file
// is smaller than the old file.
stream.Size = 0;
await MyInkCanvas.InkPresenter.StrokeContainer.SaveAsync(stream);
}
//MainPage.NotifyUser("File has been saved!", NotifyType.StatusMessage);
}
catch (Exception ex)
{
//MainPage.NotifyUser(ex.Message, NotifyType.ErrorMessage);
}
}
SaveGIF.IsChecked = false;
}
But when I do so, the finished .gif file is cropped and has dimensions like 421x643.
What can I change to fix this?