本文整理汇总了C#中platform.include.Point2I._setX方法的典型用法代码示例。如果您正苦于以下问题:C# Point2I._setX方法的具体用法?C# Point2I._setX怎么用?C# Point2I._setX使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类platform.include.Point2I
的用法示例。
在下文中一共展示了Point2I._setX方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: _normalPoint
public Point2I _normalPoint(Point2I nPoint)
{
int width_ = mWidth * 2 - 3;
int height_ = mHeight * 3 - 3;
Point2I point_ = new Point2I(nPoint);
int x_ = point_._getX();
if (x_ < 3)
{
point_._setX(3);
}
if (x_ > width_)
{
point_._setX(width_);
}
int y_ = point_._getY();
if (y_ < 3)
{
point_._setY(3);
}
if (y_ > height_)
{
point_._setY(height_);
}
return point_;
}
示例2: Point2I
public static Point2I operator -(Point2I nLeft, Point2I nRight)
{
Point2I result_ = new Point2I();
result_._setX(nLeft._getX() - nRight._getX());
result_._setY(nLeft._getY() - nRight._getY());
return result_;
}
示例3: _begPoint
public Point2I _begPoint(int nLength = 16)
{
Point2I point_ = this._vector();
float length_ = this._length();
if (length_ < nLength)
{
return null;
}
float x_ = point_._getX() / length_;
float y_ = point_._getY() / length_;
Point2I result_ = new Point2I();
result_._setX((int)(nLength * x_ + mBeg._getX()));
result_._setY((int)(nLength * y_ + mBeg._getY()));
return result_;
}
示例4: Rect2I
public Rect2I(Point2I nPoint, Size2I nSize)
{
Point2I point_ = new Point2I();
point_._setX(nPoint._getX() + nSize._getWidth());
point_._setY(nPoint._getY() + nSize._getHeight());
__tuple<Point2I, Point2I> tuple_ = nPoint._minMax(point_);
Point2I min_ = tuple_._get_0();
Point2I max_ = tuple_._get_1();
Size2I size_ = new Size2I();
size_._setWidth(max_._getX() - min_._getX());
size_._setHeight(max_._getY() - min_._getY());
mPoint = new Point2I(min_);
mSize = new Size2I(size_);
}
示例5: _getRTPoint
public Point2I _getRTPoint()
{
Point2I result_ = new Point2I();
result_._setX(this._getX() + this._getWidth());
result_._setY(this._getY());
return result_;
}
示例6: _getLBPoint
public Point2I _getLBPoint()
{
Point2I result_ = new Point2I();
result_._setX(this._getX());
result_._setY(this._getY() + this._getHeight());
return result_;
}
示例7: _connectPoint
public Point2I _connectPoint(Point2I nPoint)
{
Point2I result_ = new Point2I();
Point2I center_ = this._centerPoint();
if (center_._getX() > nPoint._getX())
{
result_._setX(mPoint._getX());
}
else
{
result_._setX(mPoint._getX() + mSize._getWidth());
}
result_._setY(center_._getY());
return result_;
}
示例8: _minMax
public __tuple<Point2I, Point2I> _minMax(int nX, int nY)
{
Point2I min_ = new Point2I();
Point2I max_ = new Point2I();
if (nX > mX)
{
min_._setX(mX);
max_._setX(nX);
}
else
{
min_._setX(nX);
max_._setX(mX);
}
if (nY > mY)
{
min_._setY(mY);
max_._setY(nY);
}
else
{
min_._setY(nY);
max_._setY(mY);
}
return new __tuple<Point2I, Point2I>(min_, max_);
}
示例9: _borderPoint
public __tuple<Status_, Point2I> _borderPoint(Point2I nPoint)
{
Point2I center_ = _centerPoint();
Point2I point_ = new Point2I();
point_._setX(nPoint._getX() - center_._getX());
point_._setY(nPoint._getY() - center_._getY());
long x_ = point_._getX() * mSize._getHeight();
long y_ = point_._getY() * mSize._getWidth();
Point2I result_ = new Point2I();
Quadrant_ quadrant_ = _getQuadrant(nPoint);
// |
// |
// _______0_______
// |
// |
// |
if (Quadrant_.mCenter_ == quadrant_)
{
return new __tuple<Status_, Point2I>(Status_.mSucess_, center_);
}
// |
// |
// _______|_______1
// |
// |
// |
else if (Quadrant_.mUdx_ == quadrant_)
{
result_._setX(mPoint._getX() + mSize._getWidth());
result_._setY(center_._getY());
return new __tuple<Status_, Point2I>(Status_.mSucess_, result_);
}
// |
// | 2
// _______|_______
// |
// |
// |
else if (Quadrant_.mFirst_ == quadrant_)
{
y_ = -y_;
if (x_ > y_)
{
result_._setX(mPoint._getX() + mSize._getWidth());
long temp_ = y_ / 2;
y_ = (int)(temp_ / point_._getX());
result_._setY((int)(center_._getY() - y_));
}
else if (x_ == y_)
{
result_._setX(mPoint._getX() + mSize._getWidth());
result_._setY(mPoint._getY());
}
else
{
result_._setY(mPoint._getY());
long temp_ = x_ / 2;
x_ = (int)(temp_ / point_._getY());
result_._setX((int)(center_._getX() - x_));
}
return new __tuple<Status_, Point2I>(Status_.mSucess_, result_);
}
// 3
// |
// |
// _______|_______
// |
// |
// |
else if (Quadrant_.mUdy_ == quadrant_)
{
result_._setX(center_._getX());
result_._setY(mPoint._getY());
return new __tuple<Status_, Point2I>(Status_.mSucess_, result_);
}
// |
// 4 |
// _______|_______
// |
// |
// |
else if (Quadrant_.mSecond_ == quadrant_)
{
x_ = -x_;
y_ = -y_;
if (x_ > y_)
{
result_._setX(mPoint._getX());
long temp_ = y_ / 2;
y_ = (int)(temp_ / point_._getX());
result_._setY((int)(center_._getY() + y_));
}
else if (x_ == y_)
{
result_._setX(mPoint._getX());
result_._setY(mPoint._getY());
}
//.........这里部分代码省略.........
示例10: _vectorTo
public Point2I _vectorTo(int nX, int nY)
{
Point2I result_ = new Point2I();
result_._setX(nX - mX);
result_._setY(nY - mY);
return result_;
}
示例11: _vectorFrom
public Point2I _vectorFrom(int nX, int nY)
{
Point2I result_ = new Point2I();
result_._setX(mX - nX);
result_._setY(mY - nY);
return result_;
}
示例12: _drawPull
public static void _drawPull(Rect2I nRect, Graphics nGraphics, RGB nRGB, int nSize = 4)
{
Point2I lefttop_ = nRect._getPoint();
lefttop_._offset(-nSize, -nSize);
Point2I righttop_ = nRect._getRTPoint();
righttop_._offset(nSize, -nSize);
Point2I leftbottom_ = nRect._getLBPoint();
leftbottom_._offset(-nSize, nSize);
Point2I rightbottom_ = nRect._getRBPoint();
rightbottom_._offset(nSize, nSize);
Point2I lt_ = new Point2I();
lt_._setX(nRect._getX() - nSize);
lt_._setY(nRect._centerY() - 3);
Point2I lb_ = new Point2I();
lb_._setX(nRect._getX() - nSize);
lb_._setY(nRect._centerY() + 3);
Point2I lp_ = new Point2I();
lp_._setX(nRect._getX() - 4);
lp_._setY(nRect._centerY());
Point2I rt_ = new Point2I();
rt_._setX(nRect._getRTX() + nSize);
rt_._setY(nRect._centerY() - 3);
Point2I rb_ = new Point2I();
rb_._setX(nRect._getRTX() + nSize);
rb_._setY(nRect._centerY() + 3);
Point2I rp_ = new Point2I();
rp_._setX(nRect._getRTX() + 4);
rp_._setY(nRect._centerY());
Line2I top_ = new Line2I(lefttop_, righttop_);
_drawBroken(top_, nGraphics, nRGB);
Line2I bottom_ = new Line2I(leftbottom_, rightbottom_);
_drawBroken(bottom_, nGraphics, nRGB);
Line2I left0_ = new Line2I(lefttop_, lt_);
_drawBroken(left0_, nGraphics, nRGB);
Line2I left1_ = new Line2I(leftbottom_, lb_);
_drawBroken(left1_, nGraphics, nRGB);
Line2I right0_ = new Line2I(righttop_, rt_);
_drawBroken(right0_, nGraphics, nRGB);
Line2I right1_ = new Line2I(rightbottom_, rb_);
_drawBroken(right1_, nGraphics, nRGB);
_drawEllipse(lp_, nGraphics, nRGB);
_drawEllipse(rp_, nGraphics, nRGB);
}
示例13: _moveInfo
__tuple<Point2I, Size2I> _moveInfo(Point2I nPoint)
{
Point2I vector_ = nPoint._vectorFrom(mMouseDown);
__tuple<Point2I, Point2I> tuple_ = this._moveMinMax();
Point2I min_ = tuple_._get_0();
Point2I max_ = tuple_._get_1();
Size2I size_ = new Size2I();
int width_ = max_._getX() - min_._getX();
int height_ = max_._getY() - min_._getY();
size_._setWidth(width_);
size_._setHeight(height_);
Point2I begin_ = new Point2I();
if (vector_._getX() > 0)
{
begin_._setX(max_._getX());
}
else
{
begin_._setX(min_._getX());
}
if (vector_._getY() > 0)
{
begin_._setY(max_._getY());
}
else
{
begin_._setY(min_._getY());
}
Point2I end_ = begin_ + vector_;
ScreenSingleton screenSingleton_ = __singleton<ScreenSingleton>._instance();
end_ = screenSingleton_._normalPoint(end_);
vector_ = end_ - begin_;
return new __tuple<Point2I, Size2I>(vector_, size_);
}
示例14: _centerPoint
public Point2I _centerPoint()
{
Point2I result_ = new Point2I();
int x_ = mSize._getWidth();
int y_ = mSize._getHeight();
x_ /= 2;
y_ /= 2;
result_._setX(mPoint._getX() + x_);
result_._setY(mPoint._getY() + y_);
return result_;
}