/// <summary> /// Draws a polyline. Add the first point also at the end of the array if the line should be closed. /// </summary> /// <param name="bmp">The WriteableBitmap.</param> /// <param name="points">The points of the polyline in x and y pairs, therefore the array is interpreted as (x1, y1, x2, y2, ..., xn, yn).</param> /// <param name="color">The color for the line.</param> public static void dbugDrawPolylineAa(this BitmapBuffer bmp, int[] points, ColorInt color) { bmp.dbugDrawPolylineAa(points, color.ToPreMultAlphaColor()); }
/// <summary> /// A Fast Bresenham Type Algorithm For Drawing Ellipses http://homepage.smc.edu/kennedy_john/belipse.pdf /// Uses a different parameter representation than DrawEllipse(). /// </summary> /// <param name="bmp">The WriteableBitmap.</param> /// <param name="xc">The x-coordinate of the ellipses center.</param> /// <param name="yc">The y-coordinate of the ellipses center.</param> /// <param name="xr">The radius of the ellipse in x-direction.</param> /// <param name="yr">The radius of the ellipse in y-direction.</param> /// <param name="color">The color for the line.</param> public static void DrawEllipseCentered(this BitmapBuffer bmp, int xc, int yc, int xr, int yr, ColorInt color) { bmp.DrawEllipseCentered(xc, yc, xr, yr, color.ToPreMultAlphaColor()); }
/// <summary> /// Draws a quad. /// </summary> /// <param name="bmp">The WriteableBitmap.</param> /// <param name="x1">The x-coordinate of the 1st point.</param> /// <param name="y1">The y-coordinate of the 1st point.</param> /// <param name="x2">The x-coordinate of the 2nd point.</param> /// <param name="y2">The y-coordinate of the 2nd point.</param> /// <param name="x3">The x-coordinate of the 3rd point.</param> /// <param name="y3">The y-coordinate of the 3rd point.</param> /// <param name="x4">The x-coordinate of the 4th point.</param> /// <param name="y4">The y-coordinate of the 4th point.</param> /// <param name="color">The color.</param> public static void DrawQuad(this BitmapBuffer bmp, int x1, int y1, int x2, int y2, int x3, int y3, int x4, int y4, ColorInt color) { bmp.DrawQuad(x1, y1, x2, y2, x3, y3, x4, y4, color.ToPreMultAlphaColor()); }
/// <summary> /// A Fast Bresenham Type Algorithm For Drawing Ellipses http://homepage.smc.edu/kennedy_john/belipse.pdf /// x2 has to be greater than x1 and y2 has to be greater than y1. /// </summary> /// <param name="bmp">The WriteableBitmap.</param> /// <param name="x1">The x-coordinate of the bounding rectangle's left side.</param> /// <param name="y1">The y-coordinate of the bounding rectangle's top side.</param> /// <param name="x2">The x-coordinate of the bounding rectangle's right side.</param> /// <param name="y2">The y-coordinate of the bounding rectangle's bottom side.</param> /// <param name="color">The color for the line.</param> public static void DrawEllipse(this BitmapBuffer bmp, int x1, int y1, int x2, int y2, ColorInt color) { bmp.DrawEllipse(x1, y1, x2, y2, color.ToPreMultAlphaColor()); }
/// <summary> /// Draws a triangle. /// </summary> /// <param name="bmp">The WriteableBitmap.</param> /// <param name="x1">The x-coordinate of the 1st point.</param> /// <param name="y1">The y-coordinate of the 1st point.</param> /// <param name="x2">The x-coordinate of the 2nd point.</param> /// <param name="y2">The y-coordinate of the 2nd point.</param> /// <param name="x3">The x-coordinate of the 3rd point.</param> /// <param name="y3">The y-coordinate of the 3rd point.</param> /// <param name="color">The color.</param> public static void DrawTriangle(this BitmapBuffer bmp, int x1, int y1, int x2, int y2, int x3, int y3, ColorInt color) { bmp.DrawTriangle(x1, y1, x2, y2, x3, y3, color.ToPreMultAlphaColor()); }