너비와 높이가 설정된 캔버스를 사용합니다. 그것은 큰 500x500이며, 또한이 방법 등을 저장할 :InkCanvas 저장에서 잘못된 치수가 생성됩니다.
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;
}
을하지만 그렇게 할 때, .gif 파일 완성은립니다 및 421x643 등의 크기를 가지고있다.
이 문제를 해결하기 위해 변경할 수있는 항목은 무엇입니까?
감사합니다. 캔버스를 만들 때 캔버스 크기를 설정했습니다. 실제로 나중에 다른 캔버스에로드하기 위해 잉크 스트로크를 저장하려고하지만 이전 캔버스의 크기와 동일한 크기로 유지하려고합니다. – JDoeDoeDoeJ