If you could adjust that method by adding an extra if statement that would be great. Then I can just update library through nuget
private void OnTaskCompleted(RenderResult r, RenderTaskState state)
{
if (r != null && !state.IsCanceled)
{
if ((int)r.Output.Width >= 1 || (int)r.Output.Height >= 1) { //-----------This if statement can fix it--------------------
WriteableBitmap wr = new WriteableBitmap((int)r.Output.Width, (int)r.Output.Height, 96, 96, PixelFormats.Bgra32, null);
// Calculate the number of bytes per pixel.
int bytesPerPixel = (wr.Format.BitsPerPixel + 7) / 8;
// Stride is bytes per pixel times the number of pixels.
// Stride is the byte width of a single rectangle row.
int stride = wr.PixelWidth * bytesPerPixel;
wr.WritePixels(new Int32Rect(0, 0, wr.PixelWidth, wr.PixelHeight), r.Image, stride, 0);
outputImage.Source = wr;
Canvas.SetLeft(outputImage, r.Output.Left);
Canvas.SetTop(outputImage, r.Output.Top);
imageCartesianRect = r.Visible;
imageSize = new Size(r.Output.Width, r.Output.Height);
outputImage.RenderTransform = null;
}
}
RaiseTaskCompletion(state.Id);
runningTasks.Remove(state);
while (tasks.Count > 1)
{
long id = tasks.Dequeue();
RaiseTaskCompletion(id);
}
if (tasks.Count > 0 && runningTasks.Count < maxTasks)
{
EnqueueTask(tasks.Dequeue());
}
InvalidateMeasure();
}