本文整理汇总了C#中Drawable.CreatePixel方法的典型用法代码示例。如果您正苦于以下问题:C# Drawable.CreatePixel方法的具体用法?C# Drawable.CreatePixel怎么用?C# Drawable.CreatePixel使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Drawable
的用法示例。
在下文中一共展示了Drawable.CreatePixel方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Render
protected override void Render(Drawable drawable)
{
var iter = new RgnIterator(drawable, _("Average"));
var average = drawable.CreatePixel();
iter.IterateSrc(pixel => average.Add(pixel));
average /= iter.Count;
iter.IterateDest(() => average);
}
示例2: Renderer
public Renderer(VariableSet variables, Drawable drawable)
: base(variables)
{
_drawable = drawable;
int bpp = drawable.Bpp;
_pixel = drawable.CreatePixel();
_color = GetValue<bool>("color");
if (drawable.HasAlpha)
{
bpp--;
_pixel.Alpha = 255;
}
_calculator = new Calculator(GetValue<int>("points"),
GetValue<int>("closest"),
bpp, drawable.MaskBounds,
(int) GetValue<UInt32>("seed"));
}
示例3: 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;
}
}
}
}