The System.Drawing.Point
structure does not define an overload of the addition operator that takes two Point
objects as parameters.
There is an addition operator that accepts a Point
object and a Size
object, and then adds the pair of numbers contained in the Size
object to the values of the Point
object. The documentation for that function is available here.
You can use that version by converting your second Point
object to a Size
object. This is pretty easy, since the Size
structure provides an explicit conversion operator for Point
, so all you have to do is cast your second Point
object to a Size
object:
position.Location = (e.Location + (Size)pic1.Location) - (Size)bild_posi.Location;
Note that I had to do the same thing for the third Point
object, since the subtraction operator is implemented the same way as the addition operator.
Unfortunately, you cannot overload existing operators in C#, but you could create a regular old function that contains the logic internally, and then call that instead of using an operator. You could even make this an extension method of the Point
class.
Edit: Nuts, it turns out I've answered this one already.