WriteableBitmapExtensions

StockSharp.Xaml.Charting.Rendering.HighSpeedRasterizer.WBX

Collection of draw extension methods for the Silverlight WriteableBitmap class.

Métodos

AlphaBlend(int, int, int, int, int) : int

Alpha blends 2 premultiplied colors with each other

sa
Source alpha color component
sr
Premultiplied source red color component
sg
Premultiplied source green color component
sb
Premultiplied source blue color component
destPixel
Premultiplied destination color

Retorna: Premultiplied blended color value

AlphaBlendNormalOnPremultiplied(Int32*, int, int, uint, uint)

Blends a specific source color on top of a destination premultiplied color

pixels
pixels array
index
Index of destination pixel
sa
Source alpha (0..255)
srb
Source non-premultiplied red and blue component in the format 0x00rr00bb
sg
Source green component (0..255)
Blit(WriteableBitmap, Rect, WriteableBitmap, Rect, Color, BlendMode)

Copies (blits) the pixels from the WriteableBitmap source to the destination WriteableBitmap (this).

bmp
The destination WriteableBitmap.
destRect
The rectangle that defines the destination region.
source
The source WriteableBitmap.
sourceRect
The rectangle that will be copied from the source to the destination.
color
If not Colors.White, will tint the source image. A partially transparent color and the image will be drawn partially transparent. If the BlendMode is ColorKeying, this color will be used as color key to mask all pixels with this value out.
BlendMode
The blending mode BlendMode.
Blit(WriteableBitmap, Point, WriteableBitmap, Rect, Color, BlendMode)

Copies (blits) the pixels from the WriteableBitmap source to the destination WriteableBitmap (this).

bmp
The destination WriteableBitmap.
destPosition
The destination position in the destination bitmap.
source
The source WriteableBitmap.
sourceRect
The rectangle that will be copied from the source to the destination.
color
If not Colors.White, will tint the source image. A partially transparent color and the image will be drawn partially transparent.
BlendMode
The blending mode BlendMode.
Blit(WriteableBitmap, Rect, WriteableBitmap, Rect)

Copies (blits) the pixels from the WriteableBitmap source to the destination WriteableBitmap (this).

bmp
The destination WriteableBitmap.
destRect
The rectangle that defines the destination region.
source
The source WriteableBitmap.
sourceRect
The rectangle that will be copied from the source to the destination.
Blit(WriteableBitmap, Rect, WriteableBitmap, Rect, BlendMode)

Copies (blits) the pixels from the WriteableBitmap source to the destination WriteableBitmap (this).

bmp
The destination WriteableBitmap.
destRect
The rectangle that defines the destination region.
source
The source WriteableBitmap.
sourceRect
The rectangle that will be copied from the source to the destination.
BlendMode
The blending mode BlendMode.
Clear(WriteableBitmap, Color)

Fills the whole WriteableBitmap with a color.

bmp
The WriteableBitmap.
color
The color used for filling.
Clear(WriteableBitmap)

Fills the whole WriteableBitmap with an empty color (0).

bmp
The WriteableBitmap.
Clone(WriteableBitmap) : WriteableBitmap

Clones the specified WriteableBitmap.

bmp
The WriteableBitmap.

Retorna: A copy of the WriteableBitmap.

CohenSutherlandLineClip(Rect, double, double, double, double) : bool

Cohen–Sutherland clipping algorithm clips a line from P0 = (x0, y0) to P1 = (x1, y1) against a rectangle with diagonal from (xmin, ymin) to (xmax, ymax).

Retorna: a list of two points in the resulting clipped line, or zero

ComputeBezierPoints(int, int, int, int, int, int, int, int, int, BitmapContext, int, int) : List<int>

Draws a filled, cubic Beziйr spline defined by start, end and two control points.

x1
The x-coordinate of the start point.
y1
The y-coordinate of the start point.
cx1
The x-coordinate of the 1st control point.
cy1
The y-coordinate of the 1st control point.
cx2
The x-coordinate of the 2nd control point.
cy2
The y-coordinate of the 2nd control point.
x2
The x-coordinate of the end point.
y2
The y-coordinate of the end point.
color
The color.
context
The bitmap context.
w
The width of the bitmap.
h
The height of the bitmap.
ComputeOutCode(Rect, double, double) : byte

Compute the bit code for a point (x, y) using the clip rectangle bounded diagonally by (xmin, ymin), and (xmax, ymax) ASSUME THAT xmax , xmin , ymax and ymin are global constants.

extents
The extents.
x
The x.
y
The y.
ComputeSegmentPoints(int, int, int, int, int, int, int, int, float, int, BitmapContext, int, int) : List<int>

Computes the discrete segment points of a Cardinal spline (cubic) defined by four control points.

x1
The x-coordinate of the 1st control point.
y1
The y-coordinate of the 1st control point.
x2
The x-coordinate of the 2nd control point.
y2
The y-coordinate of the 2nd control point.
x3
The x-coordinate of the 3rd control point.
y3
The y-coordinate of the 3rd control point.
x4
The x-coordinate of the 4th control point.
y4
The y-coordinate of the 4th control point.
tension
The tension of the curve defines the shape. Usually between 0 and 1. 0 would be a straight line.
color
The color.
context
The context containing the pixels array.
w
The width of the bitmap.
h
The height of the bitmap.
Convolute(WriteableBitmap, Int32[0:,0:]) : WriteableBitmap

Creates a new filtered WriteableBitmap.

bmp
The WriteableBitmap.
kernel
The kernel used for convolution.

Retorna: A new WriteableBitmap that is a filtered version of the input.

Convolute(WriteableBitmap, Int32[0:,0:], int, int) : WriteableBitmap

Creates a new filtered WriteableBitmap.

bmp
The WriteableBitmap.
kernel
The kernel used for convolution.
kernelFactorSum
The factor used for the kernel summing.
kernelOffsetSum
The offset used for the kernel summing.

Retorna: A new WriteableBitmap that is a filtered version of the input.

DrawBezier(WriteableBitmap, int, int, int, int, int, int, int, int, Color)

Draws a cubic Beziér spline defined by start, end and two control points.

bmp
The WriteableBitmap.
x1
The x-coordinate of the start point.
y1
The y-coordinate of the start point.
cx1
The x-coordinate of the 1st control point.
cy1
The y-coordinate of the 1st control point.
cx2
The x-coordinate of the 2nd control point.
cy2
The y-coordinate of the 2nd control point.
x2
The x-coordinate of the end point.
y2
The y-coordinate of the end point.
color
The color.
DrawBezier(WriteableBitmap, int, int, int, int, int, int, int, int, int)

Draws a cubic Beziér spline defined by start, end and two control points.

bmp
The WriteableBitmap.
x1
The x-coordinate of the start point.
y1
The y-coordinate of the start point.
cx1
The x-coordinate of the 1st control point.
cy1
The y-coordinate of the 1st control point.
cx2
The x-coordinate of the 2nd control point.
cy2
The y-coordinate of the 2nd control point.
x2
The x-coordinate of the end point.
y2
The y-coordinate of the end point.
color
The color.
DrawBeziers(WriteableBitmap, int[], int)

Draws a series of cubic Beziér splines each defined by start, end and two control points. The ending point of the previous curve is used as starting point for the next. Therfore the inital curve needs four points and the subsequent 3 (2 control and 1 end point).

bmp
The WriteableBitmap.
points
The points for the curve in x and y pairs, therefore the array is interpreted as (x1, y1, cx1, cy1, cx2, cy2, x2, y2, cx3, cx4 ..., xn, yn).
color
The color for the spline.
DrawBeziers(WriteableBitmap, int[], Color)

Draws a series of cubic Beziér splines each defined by start, end and two control points. The ending point of the previous curve is used as starting point for the next. Therfore the inital curve needs four points and the subsequent 3 (2 control and 1 end point).

bmp
The WriteableBitmap.
points
The points for the curve in x and y pairs, therefore the array is interpreted as (x1, y1, cx1, cy1, cx2, cy2, x2, y2, cx3, cx4 ..., xn, yn).
color
The color for the spline.
DrawCurve(WriteableBitmap, int[], float, int)

Draws a Cardinal spline (cubic) defined by a point collection. The cardinal spline passes through each point in the collection.

bmp
The WriteableBitmap.
points
The points for the curve in x and y pairs, therefore the array is interpreted as (x1, y1, x2, y2, x3, y3, x4, y4, x1, x2 ..., xn, yn).
tension
The tension of the curve defines the shape. Usually between 0 and 1. 0 would be a straight line.
color
The color for the spline.
DrawCurve(WriteableBitmap, int[], float, Color)

Draws a Cardinal spline (cubic) defined by a point collection. The cardinal spline passes through each point in the collection.

bmp
The WriteableBitmap.
points
The points for the curve in x and y pairs, therefore the array is interpreted as (x1, y1, x2, y2, x3, y3, x4, y4, x1, x2 ..., xn, yn).
tension
The tension of the curve defines the shape. Usually between 0 and 1. 0 would be a straight line.
color
The color for the spline.
DrawCurveClosed(WriteableBitmap, int[], float, int)

Draws a closed Cardinal spline (cubic) defined by a point collection. The cardinal spline passes through each point in the collection.

bmp
The WriteableBitmap.
points
The points for the curve in x and y pairs, therefore the array is interpreted as (x1, y1, x2, y2, x3, y3, x4, y4, x1, x2 ..., xn, yn).
tension
The tension of the curve defines the shape. Usually between 0 and 1. 0 would be a straight line.
color
The color for the spline.
DrawCurveClosed(WriteableBitmap, int[], float, Color)

Draws a closed Cardinal spline (cubic) defined by a point collection. The cardinal spline passes through each point in the collection.

bmp
The WriteableBitmap.
points
The points for the curve in x and y pairs, therefore the array is interpreted as (x1, y1, x2, y2, x3, y3, x4, y4, x1, x2 ..., xn, yn).
tension
The tension of the curve defines the shape. Usually between 0 and 1. 0 would be a straight line.
color
The color for the spline.
DrawCurveSegment(int, int, int, int, int, int, int, int, float, int, BitmapContext, int, int)

Draws a segment of a Cardinal spline (cubic) defined by four control points.

x1
The x-coordinate of the 1st control point.
y1
The y-coordinate of the 1st control point.
x2
The x-coordinate of the 2nd control point.
y2
The y-coordinate of the 2nd control point.
x3
The x-coordinate of the 3rd control point.
y3
The y-coordinate of the 3rd control point.
x4
The x-coordinate of the 4th control point.
y4
The y-coordinate of the 4th control point.
tension
The tension of the curve defines the shape. Usually between 0 and 1. 0 would be a straight line.
color
The color.
context
The context containing the pixels array.
w
The width of the bitmap.
h
The height of the bitmap.
DrawEllipse(WriteableBitmap, int, int, int, int, int, int)

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.

bmp
The WriteableBitmap.
x1
The x-coordinate of the bounding rectangle's left side.
y1
The y-coordinate of the bounding rectangle's top side.
x2
The x-coordinate of the bounding rectangle's right side.
y2
The y-coordinate of the bounding rectangle's bottom side.
color
The color for the line.
thickness
The thickness for the line
DrawEllipseCentered(WriteableBitmap, int, int, int, int, Color)

A Fast Bresenham Type Algorithm For Drawing Ellipses http://homepage.smc.edu/kennedy_john/belipse.pdf Uses a different parameter representation than DrawEllipse().

bmp
The WriteableBitmap.
xc
The x-coordinate of the ellipses center.
yc
The y-coordinate of the ellipses center.
xr
The radius of the ellipse in x-direction.
yr
The radius of the ellipse in y-direction.
color
The color for the line.
DrawEllipseCentered(WriteableBitmap, int, int, int, int, int)

A Fast Bresenham Type Algorithm For Drawing Ellipses http://homepage.smc.edu/kennedy_john/belipse.pdf Uses a different parameter representation than DrawEllipse().

bmp
The WriteableBitmap.
xc
The x-coordinate of the ellipses center.
yc
The y-coordinate of the ellipses center.
xr
The radius of the ellipse in x-direction.
yr
The radius of the ellipse in y-direction.
color
The color for the line.
DrawLine(WriteableBitmap, int, int, int, int, int)

Draws a colored line by connecting two points using an optimized DDA.

bmp
The WriteableBitmap.
x1
The x-coordinate of the start point.
y1
The y-coordinate of the start point.
x2
The x-coordinate of the end point.
y2
The y-coordinate of the end point.
color
The color for the line.
DrawLine(BitmapContext, int, int, int, int, int, int, int)

Draws a colored line by connecting two points using an optimized DDA. Uses the pixels array and the width directly for best performance.

context
A context containing the pixels as int RGBA value.
pixelWidth
The width of one scanline in the pixels array.
pixelHeight
The height of the bitmap.
x1
The x-coordinate of the start point.
y1
The y-coordinate of the start point.
x2
The x-coordinate of the end point.
y2
The y-coordinate of the end point.
color
The color for the line.
DrawLine(WriteableBitmap, int, int, int, int, Color)

Draws a colored line by connecting two points using an optimized DDA.

bmp
The WriteableBitmap.
x1
The x-coordinate of the start point.
y1
The y-coordinate of the start point.
x2
The x-coordinate of the end point.
y2
The y-coordinate of the end point.
color
The color for the line.
DrawLineAa(WriteableBitmap, int, int, int, int, Color)

Draws an anti-aliased line, using an optimized version of Gupta-Sproull algorithm From http://nokola.com/blog/post/2010/10/14/Anti-aliased-Lines-And-Optimizing-Code-for-Windows-Phone-7e28093First-Look.aspx The WriteableBitmap.The x-coordinate of the start point.The y-coordinate of the start point.The x-coordinate of the end point.The y-coordinate of the end point.The color for the line.

DrawLineAa(BitmapContext, int, int, int, int, int, int, int, bool)

Draws an anti-aliased line, using an optimized version of Gupta-Sproull algorithm From http://nokola.com/blog/post/2010/10/14/Anti-aliased-Lines-And-Optimizing-Code-for-Windows-Phone-7e28093First-Look.aspx A context containing the pixels as int RGBA value.The width of one scanline in the pixels array.The height of the bitmap.The x-coordinate of the start point.The y-coordinate of the start point.The x-coordinate of the end point.The y-coordinate of the end point.The color for the line.

DrawLineAa(WriteableBitmap, int, int, int, int, int)

Draws an anti-aliased line, using an optimized version of Gupta-Sproull algorithm From http://nokola.com/blog/post/2010/10/14/Anti-aliased-Lines-And-Optimizing-Code-for-Windows-Phone-7e28093First-Look.aspx The WriteableBitmap.The x-coordinate of the start point.The y-coordinate of the start point.The x-coordinate of the end point.The y-coordinate of the end point.The color for the line.

DrawLineBresenham(WriteableBitmap, int, int, int, int, int)

Draws a colored line by connecting two points using the Bresenham algorithm.

bmp
The WriteableBitmap.
x1
The x-coordinate of the start point.
y1
The y-coordinate of the start point.
x2
The x-coordinate of the end point.
y2
The y-coordinate of the end point.
color
The color for the line.
DrawLineBresenham(WriteableBitmap, int, int, int, int, Color)

Draws a colored line by connecting two points using the Bresenham algorithm.

bmp
The WriteableBitmap.
x1
The x-coordinate of the start point.
y1
The y-coordinate of the start point.
x2
The x-coordinate of the end point.
y2
The y-coordinate of the end point.
color
The color for the line.
DrawLineDDA(WriteableBitmap, int, int, int, int, int)

Draws a colored line by connecting two points using a DDA algorithm (Digital Differential Analyzer).

bmp
The WriteableBitmap.
x1
The x-coordinate of the start point.
y1
The y-coordinate of the start point.
x2
The x-coordinate of the end point.
y2
The y-coordinate of the end point.
color
The color for the line.
DrawLineDDA(WriteableBitmap, int, int, int, int, Color)

Draws a colored line by connecting two points using a DDA algorithm (Digital Differential Analyzer).

bmp
The WriteableBitmap.
x1
The x-coordinate of the start point.
y1
The y-coordinate of the start point.
x2
The x-coordinate of the end point.
y2
The y-coordinate of the end point.
color
The color for the line.
DrawPolyline(WriteableBitmap, int[], Color)

Draws a polyline. Add the first point also at the end of the array if the line should be closed.

bmp
The WriteableBitmap.
points
The points of the polyline in x and y pairs, therefore the array is interpreted as (x1, y1, x2, y2, ..., xn, yn).
color
The color for the line.
DrawPolyline(WriteableBitmap, int[], int)

Draws a polyline. Add the first point also at the end of the array if the line should be closed.

bmp
The WriteableBitmap.
points
The points of the polyline in x and y pairs, therefore the array is interpreted as (x1, y1, x2, y2, ..., xn, yn).
color
The color for the line.
DrawQuad(WriteableBitmap, int, int, int, int, int, int, int, int, Color)

Draws a quad.

bmp
The WriteableBitmap.
x1
The x-coordinate of the 1st point.
y1
The y-coordinate of the 1st point.
x2
The x-coordinate of the 2nd point.
y2
The y-coordinate of the 2nd point.
x3
The x-coordinate of the 3rd point.
y3
The y-coordinate of the 3rd point.
x4
The x-coordinate of the 4th point.
y4
The y-coordinate of the 4th point.
color
The color.
DrawQuad(WriteableBitmap, int, int, int, int, int, int, int, int, int)

Draws a quad.

bmp
The WriteableBitmap.
x1
The x-coordinate of the 1st point.
y1
The y-coordinate of the 1st point.
x2
The x-coordinate of the 2nd point.
y2
The y-coordinate of the 2nd point.
x3
The x-coordinate of the 3rd point.
y3
The y-coordinate of the 3rd point.
x4
The x-coordinate of the 4th point.
y4
The y-coordinate of the 4th point.
color
The color.
DrawRectangle(WriteableBitmap, int, int, int, int, int)

Draws a rectangle. x2 has to be greater than x1 and y2 has to be greater than y1.

bmp
The WriteableBitmap.
x1
The x-coordinate of the bounding rectangle's left side.
y1
The y-coordinate of the bounding rectangle's top side.
x2
The x-coordinate of the bounding rectangle's right side.
y2
The y-coordinate of the bounding rectangle's bottom side.
color
The color.
DrawRectangle(WriteableBitmap, int, int, int, int, Color)

Draws a rectangle. x2 has to be greater than x1 and y2 has to be greater than y1.

bmp
The WriteableBitmap.
x1
The x-coordinate of the bounding rectangle's left side.
y1
The y-coordinate of the bounding rectangle's top side.
x2
The x-coordinate of the bounding rectangle's right side.
y2
The y-coordinate of the bounding rectangle's bottom side.
color
The color.
DrawTriangle(WriteableBitmap, int, int, int, int, int, int, Color)

Draws a triangle.

bmp
The WriteableBitmap.
x1
The x-coordinate of the 1st point.
y1
The y-coordinate of the 1st point.
x2
The x-coordinate of the 2nd point.
y2
The y-coordinate of the 2nd point.
x3
The x-coordinate of the 3rd point.
y3
The y-coordinate of the 3rd point.
color
The color.
DrawTriangle(WriteableBitmap, int, int, int, int, int, int, int)

Draws a triangle.

bmp
The WriteableBitmap.
x1
The x-coordinate of the 1st point.
y1
The y-coordinate of the 1st point.
x2
The x-coordinate of the 2nd point.
y2
The y-coordinate of the 2nd point.
x3
The x-coordinate of the 3rd point.
y3
The y-coordinate of the 3rd point.
color
The color.
DrawWuLine(BitmapContext, int, int, short, short, short, short, int, int, int, int)

Draws an anti-aliased, alpha blended, colored line by connecting two points using Wu's antialiasing algorithm Uses the pixels array and the width directly for best performance.

context
An array containing the pixels as int RGBA value.
pixelWidth
The width of one scanline in the pixels array.
pixelHeight
The height of the bitmap.
X0
The x0.
Y0
The y0.
X1
The x1.
Y1
The y1.
sa
Alpha color component
sr
Premultiplied red color component
sg
Premultiplied green color component
sb
Premultiplied blue color component
FillBeziers(WriteableBitmap, int[], Color)

Draws a series of filled, cubic Beziйr splines each defined by start, end and two control points. The ending point of the previous curve is used as starting point for the next. Therfore the inital curve needs four points and the subsequent 3 (2 control and 1 end point).

bmp
The WriteableBitmap.
points
The points for the curve in x and y pairs, therefore the array is interpreted as (x1, y1, cx1, cy1, cx2, cy2, x2, y2, cx3, cx4 ..., xn, yn).
color
The color for the spline.
FillBeziers(WriteableBitmap, int[], int)

Draws a series of filled, cubic Beziйr splines each defined by start, end and two control points. The ending point of the previous curve is used as starting point for the next. Therfore the inital curve needs four points and the subsequent 3 (2 control and 1 end point).

bmp
The WriteableBitmap.
points
The points for the curve in x and y pairs, therefore the array is interpreted as (x1, y1, cx1, cy1, cx2, cy2, x2, y2, cx3, cx4 ..., xn, yn).
color
The color for the spline.
FillCurve(WriteableBitmap, int[], float, int)

Draws a filled Cardinal spline (cubic) defined by a point collection. The cardinal spline passes through each point in the collection.

bmp
The WriteableBitmap.
points
The points for the curve in x and y pairs, therefore the array is interpreted as (x1, y1, x2, y2, x3, y3, x4, y4, x1, x2 ..., xn, yn).
tension
The tension of the curve defines the shape. Usually between 0 and 1. 0 would be a straight line.
color
The color for the spline.
FillCurve(WriteableBitmap, int[], float, Color)

Draws a filled Cardinal spline (cubic) defined by a point collection. The cardinal spline passes through each point in the collection.

bmp
The WriteableBitmap.
points
The points for the curve in x and y pairs, therefore the array is interpreted as (x1, y1, x2, y2, x3, y3, x4, y4, x1, x2 ..., xn, yn).
tension
The tension of the curve defines the shape. Usually between 0 and 1. 0 would be a straight line.
color
The color for the spline.
FillCurveClosed(WriteableBitmap, int[], float, Color)

Draws a filled, closed Cardinal spline (cubic) defined by a point collection. The cardinal spline passes through each point in the collection.

bmp
The WriteableBitmap.
points
The points for the curve in x and y pairs, therefore the array is interpreted as (x1, y1, x2, y2, x3, y3, x4, y4, x1, x2 ..., xn, yn).
tension
The tension of the curve defines the shape. Usually between 0 and 1. 0 would be a straight line.
color
The color for the spline.
FillCurveClosed(WriteableBitmap, int[], float, int)

Draws a filled, closed Cardinal spline (cubic) defined by a point collection. The cardinal spline passes through each point in the collection.

bmp
The WriteableBitmap.
points
The points for the curve in x and y pairs, therefore the array is interpreted as (x1, y1, x2, y2, x3, y3, x4, y4, x1, x2 ..., xn, yn).
tension
The tension of the curve defines the shape. Usually between 0 and 1. 0 would be a straight line.
color
The color for the spline.
FillEllipse(WriteableBitmap, int, int, int, int, Color)

A Fast Bresenham Type Algorithm For Drawing filled ellipses http://homepage.smc.edu/kennedy_john/belipse.pdf x2 has to be greater than x1 and y2 has to be greater than y1.

bmp
The WriteableBitmap.
x1
The x-coordinate of the bounding rectangle's left side.
y1
The y-coordinate of the bounding rectangle's top side.
x2
The x-coordinate of the bounding rectangle's right side.
y2
The y-coordinate of the bounding rectangle's bottom side.
color
The color for the line.
FillEllipse(WriteableBitmap, int, int, int, int, int)

A Fast Bresenham Type Algorithm For Drawing filled ellipses http://homepage.smc.edu/kennedy_john/belipse.pdf x2 has to be greater than x1 and y2 has to be greater than y1.

bmp
The WriteableBitmap.
x1
The x-coordinate of the bounding rectangle's left side.
y1
The y-coordinate of the bounding rectangle's top side.
x2
The x-coordinate of the bounding rectangle's right side.
y2
The y-coordinate of the bounding rectangle's bottom side.
color
The color for the line.
FillEllipseCentered(WriteableBitmap, int, int, int, int, int)

A Fast Bresenham Type Algorithm For Drawing filled ellipses http://homepage.smc.edu/kennedy_john/belipse.pdf Uses a different parameter representation than DrawEllipse().

bmp
The WriteableBitmap.
xc
The x-coordinate of the ellipses center.
yc
The y-coordinate of the ellipses center.
xr
The radius of the ellipse in x-direction.
yr
The radius of the ellipse in y-direction.
color
The color for the line.
FillEllipseCentered(WriteableBitmap, int, int, int, int, Color)

A Fast Bresenham Type Algorithm For Drawing filled ellipses http://homepage.smc.edu/kennedy_john/belipse.pdf Uses a different parameter representation than DrawEllipse().

bmp
The WriteableBitmap.
xc
The x-coordinate of the ellipses center.
yc
The y-coordinate of the ellipses center.
xr
The radius of the ellipse in x-direction.
yr
The radius of the ellipse in y-direction.
color
The color for the line.
FillPolygon(WriteableBitmap, int[], Func<int, int, int>, BlendMode)

Draws a filled polygon. Add the first point also at the end of the array if the line should be closed.

bmp
The WriteableBitmap.
points
The points of the polygon in x and y pairs, therefore the array is interpreted as (x1, y1, x2, y2, ..., xn, yn).
colorCb
The color for the fill.
blendMode
The blend mode. Default is Alpha
FillPolygon(WriteableBitmap, int[], int, BlendMode)

Draws a filled polygon. Add the first point also at the end of the array if the line should be closed.

bmp
The WriteableBitmap.
points
The points of the polygon in x and y pairs, therefore the array is interpreted as (x1, y1, x2, y2, ..., xn, yn).
color
The color for the line.
blendMode
The blend mode. Default is Alpha
FillPolygon(WriteableBitmap, int[], Color)

Draws a filled polygon. Add the first point also at the end of the array if the line should be closed.

bmp
The WriteableBitmap.
points
The points of the polygon in x and y pairs, therefore the array is interpreted as (x1, y1, x2, y2, ..., xn, yn).
color
The color for the line.
FillQuad(WriteableBitmap, int, int, int, int, int, int, int, int, int)

Draws a filled quad.

bmp
The WriteableBitmap.
x1
The x-coordinate of the 1st point.
y1
The y-coordinate of the 1st point.
x2
The x-coordinate of the 2nd point.
y2
The y-coordinate of the 2nd point.
x3
The x-coordinate of the 3rd point.
y3
The y-coordinate of the 3rd point.
x4
The x-coordinate of the 4th point.
y4
The y-coordinate of the 4th point.
color
The color.
FillQuad(WriteableBitmap, int, int, int, int, int, int, int, int, Color)

Draws a filled quad.

bmp
The WriteableBitmap.
x1
The x-coordinate of the 1st point.
y1
The y-coordinate of the 1st point.
x2
The x-coordinate of the 2nd point.
y2
The y-coordinate of the 2nd point.
x3
The x-coordinate of the 3rd point.
y3
The y-coordinate of the 3rd point.
x4
The x-coordinate of the 4th point.
y4
The y-coordinate of the 4th point.
color
The color.
FillRectangle(WriteableBitmap, int, int, int, int, Color)

Draws a filled rectangle. x2 has to be greater than x1 and y2 has to be greater than y1.

bmp
The WriteableBitmap.
x1
The x-coordinate of the bounding rectangle's left side.
y1
The y-coordinate of the bounding rectangle's top side.
x2
The x-coordinate of the bounding rectangle's right side.
y2
The y-coordinate of the bounding rectangle's bottom side.
color
The color.
FillRectangle(WriteableBitmap, int, int, int, int, int, BlendMode)

Draws a filled rectangle. x2 has to be greater than x1 and y2 has to be greater than y1.

bmp
The WriteableBitmap.
x1
The x-coordinate of the bounding rectangle's left side.
y1
The y-coordinate of the bounding rectangle's top side.
x2
The x-coordinate of the bounding rectangle's right side.
y2
The y-coordinate of the bounding rectangle's bottom side.
color
The color.
blendMode
The blend mode.
FillRectangle(WriteableBitmap, int, int, int, int, Func<int, int, int>, BlendMode)

Draws a filled rectangle. x2 has to be greater than x1 and y2 has to be greater than y1.

bmp
The WriteableBitmap.
x1
The x-coordinate of the bounding rectangle's left side.
y1
The y-coordinate of the bounding rectangle's top side.
x2
The x-coordinate of the bounding rectangle's right side.
y2
The y-coordinate of the bounding rectangle's bottom side.
colorCb
The color.
blendMode
The blend mode.
FillTriangle(WriteableBitmap, int, int, int, int, int, int, int)

Draws a filled triangle.

bmp
The WriteableBitmap.
x1
The x-coordinate of the 1st point.
y1
The y-coordinate of the 1st point.
x2
The x-coordinate of the 2nd point.
y2
The y-coordinate of the 2nd point.
x3
The x-coordinate of the 3rd point.
y3
The y-coordinate of the 3rd point.
color
The color.
FillTriangle(WriteableBitmap, int, int, int, int, int, int, Color)

Draws a filled triangle.

bmp
The WriteableBitmap.
x1
The x-coordinate of the 1st point.
y1
The y-coordinate of the 1st point.
x2
The x-coordinate of the 2nd point.
y2
The y-coordinate of the 2nd point.
x3
The x-coordinate of the 3rd point.
y3
The y-coordinate of the 3rd point.
color
The color.
Flip(WriteableBitmap, FlipMode) : WriteableBitmap

Flips (reflects the image) eiter vertical or horizontal.

bmp
The WriteableBitmap.
flipMode
The flip mode.

Retorna: A new WriteableBitmap that is a flipped version of the input.

ForEach(WriteableBitmap, Func<int, int, Color>)

Applies the given function to all the pixels of the bitmap in order to set their color.

bmp
The WriteableBitmap.
func
The function to apply. With parameters x, y and a color as a result
ForEach(WriteableBitmap, Func<int, int, Color, Color>)

Applies the given function to all the pixels of the bitmap in order to set their color.

bmp
The WriteableBitmap.
func
The function to apply. With parameters x, y, source color and a color as a result
FromByteArray(WriteableBitmap, byte[]) : WriteableBitmap

Copies all the color information from an ARGB byte array into this WriteableBitmap.

bmp
The WriteableBitmap.
buffer
The color buffer as byte ARGB values.

Retorna: The WriteableBitmap that was passed as parameter.

FromByteArray(WriteableBitmap, byte[], int) : WriteableBitmap

Copies color information from an ARGB byte array into this WriteableBitmap.

bmp
The WriteableBitmap.
count
The number of bytes to copy from the buffer.
buffer
The color buffer as byte ARGB values.

Retorna: The WriteableBitmap that was passed as parameter.

FromByteArray(WriteableBitmap, byte[], int, int) : WriteableBitmap

Copies color information from an ARGB byte array into this WriteableBitmap starting at a specific buffer index.

bmp
The WriteableBitmap.
offset
The starting index in the buffer.
count
The number of bytes to copy from the buffer.
buffer
The color buffer as byte ARGB values.

Retorna: The WriteableBitmap that was passed as parameter.

FromContent(WriteableBitmap, string) : WriteableBitmap

Loads an image from the applications content and fills this WriteableBitmap with it.

bmp
The WriteableBitmap.
relativePath
Only the relative path to the content file.

Retorna: The WriteableBitmap that was passed as parameter.

FromResource(WriteableBitmap, string) : WriteableBitmap

Loads an image from the applications resource file and fills this WriteableBitmap with it.

bmp
The WriteableBitmap.
relativePath
Only the relative path to the resource file. The assembly name is retrieved automatically.

Retorna: The WriteableBitmap that was passed as parameter.

GetBrightness(WriteableBitmap, int, int) : byte

Gets the brightness / luminance of the pixel at the x, y coordinate as byte.

bmp
The WriteableBitmap.
x
The x coordinate of the pixel.
y
The y coordinate of the pixel.

Retorna: The brightness of the pixel at x, y.

GetPixel(WriteableBitmap, int, int) : Color

Gets the color of the pixel at the x, y coordinate as a Color struct. For best performance this method should not be used in iterative real-time scenarios. Implement the code directly inside a loop.

bmp
The WriteableBitmap.
x
The x coordinate of the pixel.
y
The y coordinate of the pixel.

Retorna: The color of the pixel at x, y as a Color struct.

GetPixeli(WriteableBitmap, int, int) : int

Gets the color of the pixel at the x, y coordinate as integer. For best performance this method should not be used in iterative real-time scenarios. Implement the code directly inside a loop.

bmp
The WriteableBitmap.
x
The x coordinate of the pixel.
y
The y coordinate of the pixel.

Retorna: The color of the pixel at x, y.

Invert(WriteableBitmap) : WriteableBitmap

Creates a new inverted WriteableBitmap and returns it.

bmp
The WriteableBitmap.

Retorna: The new inverted WriteableBitmap.

Resize(BitmapContext, int, int, int, int, Interpolation) : int[]

Creates a new resized bitmap.

srcContext
The source context.
widthSource
The width of the source pixels.
heightSource
The height of the source pixels.
width
The new desired width.
height
The new desired height.
interpolation
The interpolation method that should be used.

Retorna: A new bitmap that is a resized version of the input.

Resize(WriteableBitmap, int, int, Interpolation) : WriteableBitmap

Creates a new resized WriteableBitmap.

bmp
The WriteableBitmap.
width
The new desired width.
height
The new desired height.
interpolation
The interpolation method that should be used.

Retorna: A new WriteableBitmap that is a resized version of the input.

Rotate(WriteableBitmap, int) : WriteableBitmap

Rotates the bitmap in 90° steps clockwise and returns a new rotated WriteableBitmap.

bmp
The WriteableBitmap.
angle
The angle in degress the bitmap should be rotated in 90° steps clockwise.

Retorna: A new WriteableBitmap that is a rotated version of the input.

RotateFree(WriteableBitmap, double, bool) : WriteableBitmap

Rotates the bitmap in any degree returns a new rotated WriteableBitmap.

bmp
The WriteableBitmap.
angle
Arbitrary angle in 360 Degrees (positive = clockwise).
crop
if true: keep the size, false: adjust canvas to new size

Retorna: A new WriteableBitmap that is a rotated version of the input.

SetPixel(WriteableBitmap, int, int, int)

Sets the color of the pixel. For best performance this method should not be used in iterative real-time scenarios. Implement the code directly inside a loop.

bmp
The WriteableBitmap.
x
The x coordinate (row).
y
The y coordinate (column).
color
The color.
SetPixel(WriteableBitmap, int, int, byte, Color)

Sets the color of the pixel using an extra alpha value. For best performance this method should not be used in iterative real-time scenarios. Implement the code directly inside a loop.

bmp
The WriteableBitmap.
x
The x coordinate (row).
y
The y coordinate (column).
a
The alpha value of the color.
color
The color.
SetPixel(WriteableBitmap, int, int, Color)

Sets the color of the pixel. For best performance this method should not be used in iterative real-time scenarios. Implement the code directly inside a loop.

bmp
The WriteableBitmap.
x
The x coordinate (row).
y
The y coordinate (column).
color
The color.
SetPixel(WriteableBitmap, int, int, byte, byte, byte, byte)

Sets the color of the pixel including the alpha value. For best performance this method should not be used in iterative real-time scenarios. Implement the code directly inside a loop.

bmp
The WriteableBitmap.
x
The x coordinate (row).
y
The y coordinate (column).
a
The alpha value of the color.
r
The red value of the color.
g
The green value of the color.
b
The blue value of the color.
SetPixel(WriteableBitmap, int, int, byte, byte, byte)

Sets the color of the pixel. For best performance this method should not be used in iterative real-time scenarios. Implement the code directly inside a loop.

bmp
The WriteableBitmap.
x
The x coordinate (row).
y
The y coordinate (column).
r
The red value of the color.
g
The green value of the color.
b
The blue value of the color.
SetPixeli(WriteableBitmap, int, byte, byte, byte)

Sets the color of the pixel using a precalculated index (faster). For best performance this method should not be used in iterative real-time scenarios. Implement the code directly inside a loop.

bmp
The WriteableBitmap.
index
The coordinate index.
r
The red value of the color.
g
The green value of the color.
b
The blue value of the color.
SetPixeli(WriteableBitmap, int, byte, Color)

Sets the color of the pixel using an extra alpha value and a precalculated index (faster). For best performance this method should not be used in iterative real-time scenarios. Implement the code directly inside a loop.

bmp
The WriteableBitmap.
index
The coordinate index.
a
The alpha value of the color.
color
The color.
SetPixeli(WriteableBitmap, int, byte, byte, byte, byte)

Sets the color of the pixel including the alpha value and using a precalculated index (faster). For best performance this method should not be used in iterative real-time scenarios. Implement the code directly inside a loop.

bmp
The WriteableBitmap.
index
The coordinate index.
a
The alpha value of the color.
r
The red value of the color.
g
The green value of the color.
b
The blue value of the color.
SetPixeli(WriteableBitmap, int, Color)

Sets the color of the pixel using a precalculated index (faster). For best performance this method should not be used in iterative real-time scenarios. Implement the code directly inside a loop.

bmp
The WriteableBitmap.
index
The coordinate index.
color
The color.
SetPixeli(WriteableBitmap, int, int)

Sets the color of the pixel using a precalculated index (faster). For best performance this method should not be used in iterative real-time scenarios. Implement the code directly inside a loop.

bmp
The WriteableBitmap.
index
The coordinate index.
color
The color.
ToByteArray(WriteableBitmap, int) : byte[]

Copies the Pixels from the WriteableBitmap into a ARGB byte array.

bmp
The WriteableBitmap.
count
The number of pixels to copy.

Retorna: The color buffer as byte ARGB values.

ToByteArray(WriteableBitmap) : byte[]

Copies all the Pixels from the WriteableBitmap into a ARGB byte array.

bmp
The WriteableBitmap.

Retorna: The color buffer as byte ARGB values.

ToByteArray(WriteableBitmap, int, int) : byte[]

Copies the Pixels from the WriteableBitmap into a ARGB byte array starting at a specific Pixels index.

bmp
The WriteableBitmap.
offset
The starting Pixels index.
count
The number of Pixels to copy, -1 for all

Retorna: The color buffer as byte ARGB values.

WriteTga(WriteableBitmap, Stream)

Writes the WriteableBitmap as a TGA image to a stream. Used with permission from Nokola: http://nokola.com/blog/post/2010/01/21/Quick-and-Dirty-Output-of-WriteableBitmap-as-TGA-Image.aspx

bmp
The WriteableBitmap.
destination
The destination stream.

Campos

INSIDE : byte

Bitfields used to partition the space into 9 regiond

KernelGaussianBlur3x3 : int[]

Gaussian blur kernel with the size 3x3

KernelGaussianBlur5x5 : int[]

Gaussian blur kernel with the size 5x5

KernelSharpen3x3 : int[]

Sharpen kernel with the size 3x3