Exemplo n.º 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_);
 }
Exemplo n.º 2
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());
 }
Exemplo n.º 3
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());
 }
Exemplo n.º 4
0
 public static void _runDraw(Line2I nLine, Graphics nGraphics, RGB nRGB, string nStyle, int nWidth = 1, Image nImage = null, string nName = null, FONT nFont = null)
 {
     PenCapProvider penCapProvider_ = __singleton<PenCapProvider>._instance();
     Color color_ = nRGB._getColor();
     Pen pen_ = new Pen(color_, nWidth);
     if ("multiEnd" == nStyle)
     {
         pen_.CustomEndCap = penCapProvider_._getMultiCap();
     }
     else if ("multiBeg" == nStyle)
     {
         pen_.CustomStartCap = penCapProvider_._getMultiCap();
     }
     else if ("multiMulti" == nStyle)
     {
         pen_.CustomStartCap = penCapProvider_._getMultiCap();
         pen_.CustomEndCap = penCapProvider_._getMultiCap();
     }
     else if ("multiAggr" == nStyle)
     {
         pen_.CustomStartCap = penCapProvider_._getMultiCap();
         pen_.CustomEndCap = penCapProvider_._getAggrCap();
     }
     else if ("multiInh" == nStyle)
     {
         pen_.CustomStartCap = penCapProvider_._getMultiCap();
         pen_.CustomEndCap = penCapProvider_._getInhCap();
     }
     else if ("multiSingle" == nStyle)
     {
         pen_.CustomStartCap = penCapProvider_._getMultiCap();
         pen_.CustomEndCap = penCapProvider_._getSingleCap();
     }
     else if ("aggrEnd" == nStyle)
     {
         pen_.CustomEndCap = penCapProvider_._getAggrCap();
     }
     else if ("aggrBeg" == nStyle)
     {
         pen_.CustomStartCap = penCapProvider_._getAggrCap();
     }
     else if ("aggrMulti" == nStyle)
     {
         pen_.CustomStartCap = penCapProvider_._getAggrCap();
         pen_.CustomEndCap = penCapProvider_._getMultiCap();
     }
     else if ("aggrAggr" == nStyle)
     {
         pen_.CustomStartCap = penCapProvider_._getAggrCap();
         pen_.CustomEndCap = penCapProvider_._getAggrCap();
     }
     else if ("aggrInh" == nStyle)
     {
         pen_.CustomStartCap = penCapProvider_._getAggrCap();
         pen_.CustomEndCap = penCapProvider_._getInhCap();
     }
     else if ("aggrSingle" == nStyle)
     {
         pen_.CustomStartCap = penCapProvider_._getAggrCap();
         pen_.CustomEndCap = penCapProvider_._getSingleCap();
     }
     else if ("inhEnd" == nStyle)
     {
         pen_.CustomEndCap = penCapProvider_._getInhCap();
     }
     else if ("inhBeg" == nStyle)
     {
         pen_.CustomStartCap = penCapProvider_._getInhCap();
     }
     else if ("inhMulti" == nStyle)
     {
         pen_.CustomStartCap = penCapProvider_._getInhCap();
         pen_.CustomEndCap = penCapProvider_._getMultiCap();
     }
     else if ("inhAggr" == nStyle)
     {
         pen_.CustomStartCap = penCapProvider_._getInhCap();
         pen_.CustomEndCap = penCapProvider_._getAggrCap();
     }
     else if ("inhInh" == nStyle)
     {
         pen_.CustomStartCap = penCapProvider_._getInhCap();
         pen_.CustomEndCap = penCapProvider_._getInhCap();
     }
     else if ("inhSingle" == nStyle)
     {
         pen_.CustomStartCap = penCapProvider_._getInhCap();
         pen_.CustomEndCap = penCapProvider_._getSingleCap();
     }
     else if ("singleEnd" == nStyle)
     {
         pen_.CustomEndCap = penCapProvider_._getSingleCap();
     }
     else if ("singleBeg" == nStyle)
     {
         pen_.CustomStartCap = penCapProvider_._getSingleCap();
     }
     else if ("singleMulti" == nStyle)
     {
         pen_.CustomStartCap = penCapProvider_._getSingleCap();
         pen_.CustomEndCap = penCapProvider_._getMultiCap();
     }
     else if ("singleAggr" == nStyle)
     {
         pen_.CustomStartCap = penCapProvider_._getSingleCap();
         pen_.CustomEndCap = penCapProvider_._getAggrCap();
     }
     else if ("singleInh" == nStyle)
     {
         pen_.CustomStartCap = penCapProvider_._getSingleCap();
         pen_.CustomEndCap = penCapProvider_._getInhCap();
     }
     else if ("singleSingle" == nStyle)
     {
         pen_.CustomStartCap = penCapProvider_._getSingleCap();
         pen_.CustomEndCap = penCapProvider_._getSingleCap();
     }
     else
     {
     }
     GraphicsState graphicsState_ = nGraphics.Save();
     nGraphics.SmoothingMode = SmoothingMode.HighQuality;
     nGraphics.DrawLine(pen_, nLine._begX(), nLine._begY(), nLine._endX(), nLine._endY());
     nGraphics.Restore(graphicsState_);
     Rect2I rect_ = new Rect2I(nLine._getBeg(), nLine._getEnd());
     Point2I imagePoint_ = nLine._begPoint();
     if (null == imagePoint_)
     {
         return;
     }
     if (nLine._begX() < nLine._endX())
     {
         imagePoint_._offset(3, 0);
     }
     else
     {
         imagePoint_._offset(-3, 0);
     }
     if (nLine._begY() < nLine._endY())
     {
         imagePoint_._offset(0, 3);
     }
     else
     {
         imagePoint_._offset(0, -3);
     }
     nGraphics.DrawImage(nImage, imagePoint_._getX(), imagePoint_._getY(), 12, 12);
     if (null == nName || "" == nName)
     {
         return;
     }
     int h_ = rect_._getHeight();
     if (h_ < 18)
     {
         return;
     }
     Point2I center_ = rect_._centerPoint();
     int x_ = center_._getX() - 50;
     int y_ = center_._getY() - 9;
     int w_ = 100;
     int hx_ = 18;
     Rect2I rect0_ = new Rect2I(x_, y_, w_, hx_);
     Graphicsos._drawString(nName, rect0_, nGraphics, nFont);
 }
Exemplo n.º 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_);
 }