Browse Source
* Fix BitmapInterpolationMode.HighQuality when downscaling * Fix SkiaSharpExtensions.ToSKSamplingOptions public API changepull/19525/head
committed by
GitHub
13 changed files with 74 additions and 5 deletions
|
After Width: | Height: | Size: 1.8 KiB |
@ -0,0 +1,39 @@ |
|||
using System.IO; |
|||
using System.Runtime.CompilerServices; |
|||
using Avalonia.Media.Imaging; |
|||
using CrossUI; |
|||
|
|||
#if AVALONIA_SKIA
|
|||
namespace Avalonia.Skia.RenderTests.CrossTests; |
|||
#elif AVALONIA_D2D
|
|||
namespace Avalonia.Direct2D1.RenderTests.CrossTests; |
|||
#else
|
|||
namespace Avalonia.RenderTests.WpfCompare.CrossTests; |
|||
#endif
|
|||
|
|||
public class ImageScalingTests() : CrossTestBase("Media/ImageScaling") |
|||
{ |
|||
[CrossFact] |
|||
public void Upscaling_With_HighQuality_Should_Be_Antialiased() |
|||
=> TestHighQualityScaling(1024); |
|||
|
|||
[CrossFact] |
|||
public void Downscaling_With_HighQuality_Should_Be_Antialiased() |
|||
=> TestHighQualityScaling(128); |
|||
|
|||
private void TestHighQualityScaling(int size, [CallerMemberName] string? testName = null) |
|||
{ |
|||
var directoryPath = Path.GetDirectoryName(typeof(ImageScalingTests).Assembly.Location); |
|||
var imagePath = Path.Join(directoryPath, "Assets", "Star512.png"); |
|||
|
|||
RenderAndCompare( |
|||
new CrossImageControl |
|||
{ |
|||
Width = size, |
|||
Height = size, |
|||
Image = new CrossBitmapImage(imagePath), |
|||
BitmapInterpolationMode = BitmapInterpolationMode.HighQuality |
|||
}, |
|||
testName); |
|||
} |
|||
} |
|||
|
After Width: | Height: | Size: 4.5 KiB |
|
After Width: | Height: | Size: 22 KiB |
Loading…
Reference in new issue