Home All Groups Group Topic Archive Search About

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

Author
14 Oct 2005 3:39 PM
MoriCristian
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

Author
15 Oct 2005 3:14 AM
Peter Huang" [MSFT]
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.

AddThis Social Bookmark Button