This question is locked. New answers and comments are not allowed.
Method Save in PngBitmapEncoder for large image(~300Kb) throwing exception:
Index was outside the bounds of the array.
at Telerik.Windows.Media.Imaging.Zip.Tree.Code(Int32 dist)
at Telerik.Windows.Media.Imaging.Zip.DeflateManager.CompressBlock(Int16[] ltree, Int16[] dtree)
at Telerik.Windows.Media.Imaging.Zip.DeflateManager.FlushBlock(Int32 buf, Int32 stored_len, Boolean eof)
at Telerik.Windows.Media.Imaging.Zip.DeflateManager.FlushBlockOnly(Boolean eof)
at Telerik.Windows.Media.Imaging.Zip.DeflateManager.ProcessSlowDeflate(Int32 flush, Int32& num)
at Telerik.Windows.Media.Imaging.Zip.DeflateManager.SlowDeflate(Int32 flush)
at Telerik.Windows.Media.Imaging.Zip.DeflateManager.Deflate(ZipBaseStream strm, Int32 flush)
at Telerik.Windows.Media.Imaging.Zip.ZipBaseStream.Deflate(Int32 flush)
at Telerik.Windows.Media.Imaging.Zip.ZipOutputStream.WriteInternal(Byte[] buf, Int32 offset, Int32 count)
at Telerik.Windows.Media.Imaging.Zip.ZipOutputStream.Write(Byte[] buffer, Int32 offset, Int32 count)
at Telerik.Windows.Media.Imaging.PngBitmapEncoder.WriteDataChunks()
at Telerik.Windows.Media.Imaging.PngBitmapEncoder.Encode(WriteableBitmap image)
at Telerik.Windows.Media.Imaging.PngBitmapEncoder.Save(Stream stream)
at Datawatch.Dashboard.XAML.Designer.Pages.Editor.DashboardEditorPage.SaveEntity()
at Datawatch.Dashboard.XAML.Designer.MainPage.SaveEntityClick(Object sender, RoutedEventArgs e)
at System.Windows.Controls.Primitives.ButtonBase.OnClick()
at System.Windows.Controls.Button.OnClick()
at Telerik.Windows.Controls.RadButton.OnClick()
at System.Windows.Controls.Primitives.ButtonBase.OnMouseLeftButtonUp(MouseButtonEventArgs e)
at System.Windows.Controls.Control.OnMouseLeftButtonUp(Control ctrl, EventArgs e)
at MS.Internal.JoltHelper.FireEvent(IntPtr unmanagedObj, IntPtr unmanagedObjArgs, Int32 argsTypeIndex, Int32 actualArgsTypeIndex, String eventName)
Maybe exist some workarounds?
Index was outside the bounds of the array.
at Telerik.Windows.Media.Imaging.Zip.Tree.Code(Int32 dist)
at Telerik.Windows.Media.Imaging.Zip.DeflateManager.CompressBlock(Int16[] ltree, Int16[] dtree)
at Telerik.Windows.Media.Imaging.Zip.DeflateManager.FlushBlock(Int32 buf, Int32 stored_len, Boolean eof)
at Telerik.Windows.Media.Imaging.Zip.DeflateManager.FlushBlockOnly(Boolean eof)
at Telerik.Windows.Media.Imaging.Zip.DeflateManager.ProcessSlowDeflate(Int32 flush, Int32& num)
at Telerik.Windows.Media.Imaging.Zip.DeflateManager.SlowDeflate(Int32 flush)
at Telerik.Windows.Media.Imaging.Zip.DeflateManager.Deflate(ZipBaseStream strm, Int32 flush)
at Telerik.Windows.Media.Imaging.Zip.ZipBaseStream.Deflate(Int32 flush)
at Telerik.Windows.Media.Imaging.Zip.ZipOutputStream.WriteInternal(Byte[] buf, Int32 offset, Int32 count)
at Telerik.Windows.Media.Imaging.Zip.ZipOutputStream.Write(Byte[] buffer, Int32 offset, Int32 count)
at Telerik.Windows.Media.Imaging.PngBitmapEncoder.WriteDataChunks()
at Telerik.Windows.Media.Imaging.PngBitmapEncoder.Encode(WriteableBitmap image)
at Telerik.Windows.Media.Imaging.PngBitmapEncoder.Save(Stream stream)
at Datawatch.Dashboard.XAML.Designer.Pages.Editor.DashboardEditorPage.SaveEntity()
at Datawatch.Dashboard.XAML.Designer.MainPage.SaveEntityClick(Object sender, RoutedEventArgs e)
at System.Windows.Controls.Primitives.ButtonBase.OnClick()
at System.Windows.Controls.Button.OnClick()
at Telerik.Windows.Controls.RadButton.OnClick()
at System.Windows.Controls.Primitives.ButtonBase.OnMouseLeftButtonUp(MouseButtonEventArgs e)
at System.Windows.Controls.Control.OnMouseLeftButtonUp(Control ctrl, EventArgs e)
at MS.Internal.JoltHelper.FireEvent(IntPtr unmanagedObj, IntPtr unmanagedObjArgs, Int32 argsTypeIndex, Int32 actualArgsTypeIndex, String eventName)
Maybe exist some workarounds?