Example #1
0
        public void BeginEndConvertPixelFormatCancelWithDefaultValueTest()
        {
            using var ref32bpp = Icons.Information.ExtractBitmap(new Size(256, 256));
            Assert.AreEqual(32, ref32bpp.GetBitsPerPixel());

            IAsyncResult ar = ref32bpp.BeginConvertPixelFormat(PixelFormat.Format8bppIndexed,
                                                               asyncConfig: new AsyncConfig(null, () => true)
            {
                ThrowIfCanceled = false
            });

            Assert.IsTrue(ar.IsCompleted);
            Assert.IsTrue(ar.CompletedSynchronously);
            Assert.IsNull(ar.EndConvertPixelFormat());
        }
Example #2
0
 internal override Bitmap EndGenerate(IAsyncResult asyncResult) => asyncResult.EndConvertPixelFormat();