AlphaTab.Platform.CSharp.Wpf.AlphaTab.AddPartialResult C# (CSharp) Method

AddPartialResult() private method

private AddPartialResult ( RenderFinishedEventArgs result ) : void
result AlphaTab.Rendering.RenderFinishedEventArgs
return void
        private void AddPartialResult(RenderFinishedEventArgs result)
        {
            lock (this)
            {
                Width = result.TotalWidth;
                Height = result.TotalHeight;
                if (result.RenderResult != null)
                {
                    var bitmap = (Bitmap) result.RenderResult;
                    IntPtr hBitmap = bitmap.GetHbitmap();
                    try
                    {
                        PartialResults.Add(Imaging.CreateBitmapSourceFromHBitmap(
                            hBitmap,
                            IntPtr.Zero, Int32Rect.Empty,
                            BitmapSizeOptions.FromWidthAndHeight(bitmap.Width, bitmap.Height)));
                    }
                    finally
                    {
                        DeleteObject(hBitmap);
                    }
                }
            }
        }