previously, there is such method for Rectangle in MFC, i dont know why there is not for the c# version.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Presumably it wasn’t deemed useful enough to merit inclusion.
You could easily add it as an extension method if you want though (and if you’re using C# 3):
Note that as the values are expressed as integers, you could easily end up getting a non-exact value, assuming you want to return a
Pointrather than another structure usingdecimalordouble.The above is actually for the
System.Drawing.Rectanglestruct. If you’re talking about a different Rectangle, please add the appropriate information and I’ll edit my answer.