csharpc-sharpdotnetxamlavaloniauicross-platformcross-platform-xamlavaloniaguimulti-platformuser-interfacedotnetcore
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
55 lines
1.4 KiB
55 lines
1.4 KiB
#if AVALONIA_SKIA
|
|
using System.Threading.Tasks;
|
|
using Avalonia.Controls;
|
|
using Avalonia.Controls.Shapes;
|
|
using Avalonia.Media;
|
|
using Avalonia.Media.Imaging;
|
|
using Avalonia.UnitTests;
|
|
using Xunit;
|
|
|
|
namespace Avalonia.Skia.RenderTests;
|
|
|
|
public class RenderTargetBitmapTests : TestBase
|
|
{
|
|
public RenderTargetBitmapTests() : base(@"Media\RenderTargetBitmap")
|
|
{
|
|
}
|
|
|
|
[Fact]
|
|
public async Task RenderTargetBitmap_DropShadowEffect()
|
|
{
|
|
var root = new Grid
|
|
{
|
|
Width = 300,
|
|
Height = 300,
|
|
Children =
|
|
{
|
|
new Canvas
|
|
{
|
|
Width = 300,
|
|
Height = 300,
|
|
Background = Brushes.White,
|
|
Children =
|
|
{
|
|
new Rectangle
|
|
{
|
|
Fill = Brushes.Red,
|
|
Width = 200,
|
|
Height = 200,
|
|
Margin = new Thickness(50),
|
|
Effect = new DropShadowEffect
|
|
{
|
|
Color = Colors.Black,
|
|
BlurRadius = 30
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
};
|
|
|
|
await RenderToFile(root);
|
|
CompareImages();
|
|
}
|
|
}
|
|
#endif
|
|
|