本文整理汇总了C#中System.Windows.Media.Imaging.WriteableBitmap.DrawLineAa方法的典型用法代码示例。如果您正苦于以下问题:C# WriteableBitmap.DrawLineAa方法的具体用法?C# WriteableBitmap.DrawLineAa怎么用?C# WriteableBitmap.DrawLineAa使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Windows.Media.Imaging.WriteableBitmap
的用法示例。
在下文中一共展示了WriteableBitmap.DrawLineAa方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DrawLineEx
public void DrawLineEx(WriteableBitmap bmp, int x, int y, int width, int height, Color color, int tick)
{
bmp.DrawLineAa(x, y, x + width, y + height, color, tick);
}
示例2: DrawRect
private void DrawRect(WriteableBitmap bitmap, int top, int right, int bottom, int left, int stroke = 10)
{
left = Math.Max(stroke, left);
top = Math.Max(stroke, top);
right = Math.Min(bitmap.PixelWidth - stroke, right);
bottom = Math.Min(bitmap.PixelHeight - stroke, bottom);
bitmap.DrawLineAa(left, top, right, top, Colors.Blue, stroke);
bitmap.DrawLineAa(right, top, right, bottom, Colors.Blue, stroke);
bitmap.DrawLineAa(left, bottom, right, bottom, Colors.Blue, stroke);
bitmap.DrawLineAa(left, top, left, bottom, Colors.Blue, stroke);
}
示例3: Draw
internal void Draw(WriteableBitmap wb, Color c)
{
if (P1 == null)
{
P1 = P2;
}
else if (P2.X < P1.X)
{
P2 = P1;
}
wb.DrawLineAa(P1.X, P1.Y, P2.X, P2.Y, c);
}
示例4: DrawPoint
private void DrawPoint(WriteableBitmap bitmap, ColorSpacePoint p)
{
bitmap.DrawLineAa(Math.Max((int)p.X - 5, 0), Math.Max((int)p.Y - 5, 0), Math.Min((int)p.X + 5, colorWidth - 1), Math.Min((int)p.Y + 5, colorHeight - 1), Colors.Cyan, 20);
}