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); }
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); }
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); }
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); }