I have a UserControl that is really wide 60 x 50,000
which is displaying the waveform of an audio file. Several users are reporting a crash with an hresult of 0x88980406
and the googles isn't giving any useful information about it. The app is using .Net 4.0.
if (mainCanvas.Children.Count > 0)
mainCanvas.Children.Clear();
for (int i = 0; i < CurrentSong.waveformLines.Length; i++)
{
mainCanvas.Children.Add(CurrentSong.waveformLines[i]);
}
RenderTargetBitmap renderBitmap = new RenderTargetBitmap((int)Width, (int)Height, 96d, 96d, PixelFormats.Pbgra32);
// needed otherwise the image output is black
mainCanvas.Measure(new Size((int)Width, (int)Height));
mainCanvas.Arrange(new Rect(new Size((int)Width, (int)Height)));
renderBitmap.Render(mainCanvas);
Image img = new Image();
img.Source = renderBitmap;
if (mainCanvas.Children.Count > 0)
mainCanvas.Children.Clear();
mainCanvas.Children.Add(img);
What I'm doing is drawing the sample values as line segments and then adding them all to an array and put them on the canvas. Then I create a bitmap from the canvas, delete all the line segments and then add the bitmap as the source of an Image control back on to the canvas.
it crashes in mainCanvas.Children.Add(img)
;
User contributions licensed under CC BY-SA 3.0