如何识别 [英] how Recognition

查看:82
本文介绍了如何识别的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想制作正方形,我在类上命名该点,并得到(x,y),然后我制作使用两个点的类,并将其命名为line,然后我用它来制作正方形,但是我如何才能将其重新赋值真实的正方形-----可能是这样的形状-----
-------这样我
----控制输入以确保我的形状是真实的正方形

i want to making square i making class that name point and get the (x,y) then i making class that use two point and named it line then i use for line to making square but how i can recogonise that `s a real square ----- like this maybe it`s shape -----
- - ----- like this how i
- --- contorl input to be sure my shape is a real square

推荐答案

我认为您没有使用最好的方法绘制正方形.对于一种可能更好的方法,请调查 System.Drawing .Rectangle [ ^ ]类或 System.Windows .Shapes.Rectangle [ ^ ]类,看看他们是如何做到的.

无论如何,您都必须意识到正方形只是矩形的一种特例,即矩形的所有边都相等.因此,无论您是否继续使用当前的方法,都必须确定所有边的长度是否相同.

为什么不去尝试一下呢,如果您有任何问题,请再次询问,显示您的代码并描述您遇到的问题.

祝你好运! :)
I think that you are not using the best method to draw your square. For a, possibly, better way investigate the System.Drawing.Rectangle[^] class or the System.Windows.Shapes.Rectangle[^] class to see how they do it.

In any event you have to realize that a square is a just a special case of a rectangle, one where all sides are equal. So whether you carry on with your current methodology or not you have to determine if all of your sides are the same length.

Why not have a go at that and, if you have any problems, ask again, showing your code and describing the problem you are having.

Good luck! :)


这篇关于如何识别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆