示例#1
0
 public void _rectDraw(Graphics nGraphics, Rect2I nRect)
 {
     ImagePos_ imagePos_ = mRectStream._getImagePos();
     Image image_ = mRectStream._getImage();
     int width_ = 12;
     int x_ = nRect._getX();
     int x1_ = x_ + width_ + 1;
     int y_ = nRect._getHeight() - width_;
     y_ /= 2;
     y_ = nRect._getY() + y_;
     int y1_ = nRect._getY();
     int w1_ = nRect._getWidth() - x1_;
     int h1_ = nRect._getHeight();
     if (imagePos_ == ImagePos_.mRectLeftTop_)
     {
         x1_ = nRect._getX();
         w1_ = nRect._getWidth();
         y_ = nRect._getY() - 11;
     }
     nGraphics.DrawImage(image_, x_ + 1, y_, width_, width_);
     string name_ = mRect._getName();
     FONT font_ = mRectStream._getFont();
     Rect2I rect_ = new Rect2I(x1_, y1_, w1_, h1_);
     Graphicsos._drawString(name_, rect_, nGraphics, font_);
 }
示例#2
0
        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);
        }
示例#3
0
 public static void _runFill(Rect2I nRect, Graphics nGraphics, RGB nRGB)
 {
     Color color_ = nRGB._getColor();
     Brush brush_ = new SolidBrush(color_);
     nGraphics.FillRectangle(brush_, nRect._getX(), nRect._getY(), nRect._getWidth(), nRect._getHeight());
 }
示例#4
0
 public static void _runDraw(Rect2I nRect, Graphics nGraphics, RGB nRGB)
 {
     Color color_ = nRGB._getColor();
     Pen pen_ = new Pen(color_);
     nGraphics.DrawRectangle(pen_, nRect._getX(), nRect._getY(), nRect._getWidth(), nRect._getHeight());
 }
示例#5
0
 public static void _drawString(string nName, Rect2I nRect, Graphics nGraphics, FONT nFont)
 {
     Font font_ = nFont._getFont();
     Color color_ = nFont._getColor();
     Brush brush_ = new SolidBrush(color_);
     string text_ = _widthString(nGraphics, font_, nName, nRect._getWidth() + 1);
     int x_ = _stringWidth(nGraphics, font_, text_);
     x_ = nRect._getWidth() - x_;
     x_ /= 2;
     x_ = nRect._getX() + x_;
     int y_ = nRect._getHeight() - font_.Height;
     y_ /= 2;
     y_ = nRect._getY() + y_ - 1;
     nGraphics.DrawString(text_, font_, brush_, x_, y_);
 }
示例#6
0
文件: Rect2I.cs 项目: zyouhua/nvwa
 public bool _intersectWith(Rect2I nRect)
 {
     Point2I lt0_ = this._getPoint();
     Point2I lb0_ = this._getLBPoint();
     Point2I rt0_ = this._getRTPoint();
     Point2I rb0_ = this._getRBPoint();
     if (nRect._contain(lt0_))
     {
         return true;
     }
     if (nRect._contain(lb0_))
     {
         return true;
     }
     if (nRect._contain(rt0_))
     {
         return true;
     }
     if (nRect._contain(rb0_))
     {
         return true;
     }
     Point2I lt1_ = nRect._getPoint();
     Point2I lb1_ = nRect._getLBPoint();
     Point2I rt1_ = nRect._getRTPoint();
     Point2I rb1_ = nRect._getRBPoint();
     if (this._contain(lt1_))
     {
         return true;
     }
     if (this._contain(lb1_))
     {
         return true;
     }
     if (this._contain(rt1_))
     {
         return true;
     }
     if (this._contain(rb1_))
     {
         return true;
     }
     int x00_ = this._getX();
     int y00_ = this._getY();
     int x01_ = this._getRTX();
     int y01_ = this._getLBY();
     int x10_ = nRect._getX();
     int y10_ = nRect._getY();
     int x11_ = nRect._getRTX();
     int y11_ = nRect._getLBY();
     if (x00_ < x10_ && x01_ > x11_ && y00_ > y10_ && y01_ < y11_)
     {
         return true;
     }
     if (x00_ > x10_ && x01_ < x11_ && y00_ < y10_ && y01_ > y11_)
     {
         return true;
     }
     return false;
 }