It's x[0,599]
and y[0,799]
. If you try and draw a pixel at 0,0
it will be the top left pixel and if you draw at 600,800
it will draw outside the Canvas. Draw a simple 50x50 canvas and run this against it to see:
for (int x = 0; x < 51; x++)
{
for (int y = 0; y < 51; y++)
{
var rect = new Rectangle
{
Stroke = Brushes.White,
StrokeThickness = 1,
Width=1,
Height=1
};
if (x == 0 & y == 0)
{
rect.Stroke = Brushes.LimeGreen;
}
if (x == 50 & y == 50)
{
rect.Stroke = Brushes.LimeGreen;
}
Canvas.SetLeft(rect, x);
Canvas.SetTop(rect, y);
youCanvasNameHere.Children.Add(rect);
}
}
You might need to use magnify.exe
to see it though.