//============================================================ // <T>开始绘制处理。</T> // // @param args 参数 //============================================================ public void Draw(SUiDrawArgs args) { FDxContext2d context = _context.Context; context.TransformIdentity(); // 计算坐标 _location.Assign(_control.CalculateDisplayPosition()); _size.Assign(_control.CalculateDisplaySize()); // 绘制选择区域 if (_designSelect) { // 绘制底版 context.FillRectangle(_selectBackColor.brush, _location.X, _location.Y, _size.Width, _size.Height); // 绘制边线 context.DrawRectangle(_selectForeColor.brush, _location.X, _location.Y, _size.Width, _size.Height); } // 绘制辅助点区域 if (_designFocus) { CalculatePoints(); foreach (SUiControlPoint point in _points) { DrawPoint(point); } } }
//============================================================ // <T>绘制处理点。</T> // // @param args 参数 //============================================================ public void DrawPoint(SUiControlPoint point) { int x = point.Point.X - 2; int y = point.Point.Y - 2; // 绘制边线 FDxContext2d context = _context.Context; context.FillRectangle(_pointBackBrush, x, y, _pointForeSize.Width, _pointForeSize.Height); context.DrawRectangle(_pointForeBrush, x, y, _pointBackSize.Width, _pointBackSize.Height); }
//============================================================ // <T>结束绘制处理。</T> // // @param args 参数 //============================================================ public virtual void OnDrawAfter(SUiDrawArgs args) { FDxContext2d context = _context.Context; // 绘制前景 DrawResource(_foreResource); // 绘制边框 DrawBorder(ControlResource.BorderInner, ControlResource.BorderOuter); //if (_optionBorder) { // SetupColor(_borderColor); // if (_borderColor.Valid) { // context.DrawRectangle(_borderColor.brush, 0, 0, _designSize.Width, _designSize.Height); // } //} // 绘制设计边框 if (_designBorder) { context.DrawRectangle(_context.DesignBorderBackColor.brush, 0, 0, _designSize.Width, _designSize.Height, 2); context.DrawRectangle(_context.DesignBorderForeColor.brush, 0, 0, _designSize.Width, _designSize.Height); } }