I use the following code to draw on a 32x32 px canvas, using the MouseMoveEvent to draw pixel sized rectangles and create Pixel graphics.
Ive created a class called RectItem
public class RectItem
{
public double X { get; set; }
public double Y { get; set; }
public double Width { get; set; }
public double Height { get; set; }
public SolidColorBrush Col { get; set; }
}
and an ObservableCollection
public ObservableCollection<RectItem> RectItems { get; set; }
I add the pixel sized rectangle via (cv is the canvas with the binding to RectItems)
RectItem rec = new RectItem { X = (int)e.GetPosition(cv).X, Y = (int)e.GetPosition(cv).Y, Width = 1, Height = 1, Col = new SolidColorBrush(CurrentColor) };
RectItems.Add(rec);
This all works fine, but how would i go about adding a pixel ellipse(like the one you can use when creating a cursor file within VS)
like the following, just without the margins.PixelRectangle