mirror of
https://github.com/DarthAffe/RGB.NET.git
synced 2025-12-13 10:08:31 +00:00
Merge pull request #190 from DarthAffe/Core/TextureImprovement
Added int overload for PixelTexture
This commit is contained in:
commit
36365e9de8
@ -46,6 +46,16 @@ namespace RGB.NET.Core
|
|||||||
int width = (int)MathF.Round(Size.Width * rectangle.Size.Width.Clamp(0, 1));
|
int width = (int)MathF.Round(Size.Width * rectangle.Size.Width.Clamp(0, 1));
|
||||||
int height = (int)MathF.Round(Size.Height * rectangle.Size.Height.Clamp(0, 1));
|
int height = (int)MathF.Round(Size.Height * rectangle.Size.Height.Clamp(0, 1));
|
||||||
|
|
||||||
|
return this[x, y, width, height];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public virtual Color this[int x, int y, int width, int height]
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
if (Data.Length == 0) return Color.Transparent;
|
||||||
|
|
||||||
if ((width == 0) || (height == 0)) return Color.Transparent;
|
if ((width == 0) || (height == 0)) return Color.Transparent;
|
||||||
if ((width == 1) && (height == 1)) return GetColor(GetPixelData(x, y));
|
if ((width == 1) && (height == 1)) return GetColor(GetPixelData(x, y));
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user