C# Won't allow me to do this.
foreach (Point point in filledPoints)
{
point.X = 0;
}
filledPoints is a List<Point>
It gives me a compiler error: "filledPoints is a foreach iteration variable, so the associated members can't be edited" (Sorry, the message is in german and im bad at translating). But this works:
foreach (Point point in filledPoints)
{
Point point2 = point;
point2.X = point2.X / oldSize.Width * Size.Width;
}
Why does this not work and is there a more elegant way to bypass it?