本文整理汇总了C#中Dimensions.IsInside方法的典型用法代码示例。如果您正苦于以下问题:C# Dimensions.IsInside方法的具体用法?C# Dimensions.IsInside怎么用?C# Dimensions.IsInside使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Dimensions
的用法示例。
在下文中一共展示了Dimensions.IsInside方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: RenderShadow
void RenderShadow(PixelFetcher pf, Drawable drawable, Dimensions dimensions)
{
int blurRadius = _newSize / 25 + 1;
int x0 = -_radius - blurRadius;
int y0 = x0;
int x1 = _newSize - _radius + blurRadius;
int y1 = x1;
var rectangle = new Rectangle(x0, y0, x1, y1);
foreach (var c in new CoordinateGenerator(rectangle))
{
if (c.Radius <= _radius * 1.1)
{
var average = drawable.CreatePixel();
int blurPixels = 0;
int m, n;
for (int k = -blurRadius; k < blurRadius + 1; k++)
{
m = X + c.X + k;
for (int l = -blurRadius; l < blurRadius + 1; l++)
{
n = Y + c.Y + l;
if (dimensions.IsInside(m, n))
{
average += pf[n, m];
blurPixels++;
}
}
}
m = X + c.X;
n = Y + c.Y;
if (dimensions.IsInside(m, n))
{
pf[n, m] = average / blurPixels;
}
}
}
}
示例2: RenderDrop
void RenderDrop(BoolMatrix boolMatrix, PixelFetcher pf,
Dimensions dimensions)
{
int x0 = -_radius;
int y0 = -_radius;
int x1 = _newSize - _radius;
int y1 = _newSize - _radius;
var rectangle = new Rectangle(x0, y0, x1, y1);
foreach (var c in new CoordinateGenerator(rectangle))
{
double r = c.Radius;
double a = c.Angle;
if (r <= _radius)
{
double oldRadius = r;
r = (Math.Exp (r / _s) - 1) / _newCoeff;
int k = X + (int) (r * Math.Sin(a));
int l = Y + (int) (r * Math.Cos(a));
int m = X + c.X;
int n = Y + c.Y;
if (dimensions.IsInside(k, l) && dimensions.IsInside(m, n))
{
boolMatrix[n, m] = true;
var newColor = pf[l, k] + GetBright(oldRadius, a);
newColor.Clamp0255();
pf[l, k] = newColor;
}
}
}
}