mirror of
https://github.com/DarthAffe/RGB.NET.git
synced 2025-12-12 17:48:31 +00:00
36 lines
772 B
C#
36 lines
772 B
C#
namespace RGB.NET.Core
|
|
{
|
|
public class TextureBrush : AbstractBrush
|
|
{
|
|
#region Properties & Fields
|
|
|
|
private ITexture _texture = ITexture.Empty;
|
|
public ITexture Texture
|
|
{
|
|
get => _texture;
|
|
set => SetProperty(ref _texture, value);
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region Constructors
|
|
|
|
public TextureBrush(ITexture texture)
|
|
{
|
|
this.Texture = texture;
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region Methods
|
|
|
|
protected override Color GetColorAtPoint(in Rectangle rectangle, in RenderTarget renderTarget)
|
|
{
|
|
Rectangle normalizedRect = renderTarget.Rectangle / rectangle;
|
|
return Texture[normalizedRect];
|
|
}
|
|
|
|
#endregion
|
|
}
|
|
}
|