@@ -303,30 +303,30 @@ private static void DoCommonCustomBitmapDataTests(string caseName, Size size, IR
303
303
AssertAreEqual ( bitmapDataDitheredContentDependent , referenceBitmapData , true ) ;
304
304
305
305
// DrawInto
306
- using IReadableBitmapData icon32 = Icons . Information . ExtractBitmap ( new Size ( 48 , 48 ) ) . GetReadableBitmapData ( ) ;
306
+ using IReadableBitmapData icon48 = GetInfoIcon48 ( ) ;
307
307
Point iconLocation = new Point ( 10 , 10 ) ;
308
308
Rectangle gradientRectangle = new Rectangle ( 60 , 10 , 50 , 42 ) ;
309
309
310
310
bitmapDataNonDithered . CopyTo ( referenceBitmapData , default , referenceQuantizer ) ;
311
- icon32 . DrawInto ( referenceBitmapData , iconLocation , referenceQuantizer ) ;
311
+ icon48 . DrawInto ( referenceBitmapData , iconLocation , referenceQuantizer ) ;
312
312
alphaGradient . DrawInto ( referenceBitmapData , gradientRectangle , referenceQuantizer ) ;
313
- icon32 . DrawInto ( bitmapDataNonDithered , iconLocation ) ;
313
+ icon48 . DrawInto ( bitmapDataNonDithered , iconLocation ) ;
314
314
alphaGradient . DrawInto ( bitmapDataNonDithered , gradientRectangle ) ;
315
315
SaveBitmapData ( $ "{ caseName } DrawInto", bitmapDataNonDithered , testName ) ;
316
316
AssertAreEqual ( referenceBitmapData , bitmapDataNonDithered , true ) ;
317
317
318
318
bitmapDataDitheredContentIndependent . CopyTo ( referenceBitmapData , default , referenceQuantizer ) ;
319
- icon32 . DrawInto ( referenceBitmapData , iconLocation , referenceQuantizer , contentIndependentDitherer ) ;
319
+ icon48 . DrawInto ( referenceBitmapData , iconLocation , referenceQuantizer , contentIndependentDitherer ) ;
320
320
alphaGradient . DrawInto ( referenceBitmapData , gradientRectangle , referenceQuantizer , contentIndependentDitherer ) ;
321
- icon32 . DrawInto ( bitmapDataDitheredContentIndependent , iconLocation , contentIndependentDitherer ) ;
321
+ icon48 . DrawInto ( bitmapDataDitheredContentIndependent , iconLocation , contentIndependentDitherer ) ;
322
322
alphaGradient . DrawInto ( bitmapDataDitheredContentIndependent , gradientRectangle , contentIndependentDitherer ) ;
323
323
SaveBitmapData ( $ "{ caseName } DrawInto independent ditherer", bitmapDataDitheredContentIndependent , testName ) ;
324
324
AssertAreEqual ( referenceBitmapData , bitmapDataDitheredContentIndependent , true ) ;
325
325
326
326
bitmapDataDitheredContentDependent . CopyTo ( referenceBitmapData , default , referenceQuantizer ) ;
327
- icon32 . DrawInto ( referenceBitmapData , iconLocation , referenceQuantizer , contentDependentDitherer ) ;
327
+ icon48 . DrawInto ( referenceBitmapData , iconLocation , referenceQuantizer , contentDependentDitherer ) ;
328
328
alphaGradient . DrawInto ( referenceBitmapData , gradientRectangle , referenceQuantizer , contentDependentDitherer ) ;
329
- icon32 . DrawInto ( bitmapDataDitheredContentDependent , iconLocation , contentDependentDitherer ) ;
329
+ icon48 . DrawInto ( bitmapDataDitheredContentDependent , iconLocation , contentDependentDitherer ) ;
330
330
alphaGradient . DrawInto ( bitmapDataDitheredContentDependent , gradientRectangle , contentDependentDitherer ) ;
331
331
SaveBitmapData ( $ "{ caseName } DrawInto dependent ditherer", bitmapDataDitheredContentDependent , testName ) ;
332
332
//AssertAreEqual(referenceBitmapData, bitmapDataDitheredContentDependent, true); //- Due to serpentine processing the resizing draw can be different on 32bpp reference and actual bitmap data
@@ -476,9 +476,8 @@ public void SupportedFormatsConsistencyTest(KnownPixelFormat pixelFormat)
476
476
{
477
477
// 0.) Reference: native to self-allocating managed bitmap data
478
478
IReadWriteBitmapData reference ;
479
- using ( Bitmap bmp = Icons . Information . ExtractBitmap ( new Size ( 256 , 256 ) ) )
479
+ using ( var bmpData = GetInfoIcon256 ( ) )
480
480
{
481
- using var bmpData = bmp . GetReadWriteBitmapData ( ) ;
482
481
int bpp = pixelFormat . ToBitsPerPixel ( ) ;
483
482
reference = bmpData . Clone ( pixelFormat , bpp <= 8 ? OptimizedPaletteQuantizer . Wu ( 1 << bpp , Color . Silver , ( byte ) ( bpp == 1 ? 0 : 128 ) ) : null , OrderedDitherer . Bayer8x8 ) ;
484
483
}
@@ -578,7 +577,7 @@ public void CustomIndexedBitmapDataTest(string testName, PixelFormatInfo pixelFo
578
577
int maxColors = 1 << bpp ;
579
578
foreach ( var getQuantizer in new Func < int , Color , byte , OptimizedPaletteQuantizer > [ ] { OptimizedPaletteQuantizer . Octree , OptimizedPaletteQuantizer . MedianCut , OptimizedPaletteQuantizer . Wu } )
580
579
{
581
- using IReadableBitmapData optimizedReferenceBitmapData = Icons . Information . ExtractBitmap ( new Size ( 256 , 256 ) ) ! . GetReadableBitmapData ( )
580
+ using IReadableBitmapData optimizedReferenceBitmapData = GetInfoIcon256 ( )
582
581
. Clone ( bpp <= 8 ? KnownPixelFormat . Format8bppIndexed : KnownPixelFormat . Format32bppArgb , getQuantizer . Invoke ( maxColors , Color . Silver , ( byte ) ( bpp == 1 ? 0 : 128 ) ) , OrderedDitherer . Bayer8x8 ) ;
583
582
size = optimizedReferenceBitmapData . GetSize ( ) ;
584
583
stride = pixelFormat . GetByteWidth ( size . Width ) ;
0 commit comments