Can't add a PointF to a SizeF!!! Why?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi.
I found out that you can't add a SizeF to a PointF but only a Size!
Is there an explanation for that? I find it Ok to add a Size to a Point, but
since PointF is float, i'd like to add a SizeF as well....

regards
Cristian Mori
 
Hi

Based on my research, this is a known issue. And we plan to fix it in the
next release Whidbey.
Because the PointF structure did implement the operator + with PointF,Size
but not SizeF.
public static PointF operator +(PointF pt, Size sz);

So far for your scenario, I think you may try to do it manually with code.
e.g.
PointF ptf = new PointF(10.5f,10.5f);
SizeF szf= new SizeF(10.6f,10.6f);
ptf.X += szf.Width;
ptf.Y += szf.Height;


Best regards,

Peter Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.
 
Back
Top