Пример #1
0
        //============================================================
        // <T>绘制处理。</T>
        //
        // @param sender 发送者
        // @param e:event 事件
        //============================================================
        public void Paint()
        {
            // 检查设置
            if (!_setuped)
            {
                return;
            }
            // 获得设备
            FDxDevice2d  device  = _context.Device;
            FDxContext2d context = _context.Context;

            context.TransformIdentity();
            // 开始绘制
            device.BeginDraw();
            // 清空目标
            context.Clear();
            // 填充背景
            if (_designBack)
            {
                context.FillRectangle(_designBackBrush.brush, 0, 0, _size.Width, _size.Height);
            }
            else
            {
                context.FillRectangle(_backBrush, 0, 0, _size.Width, _size.Height);
            }
            // 绘制预览层
            DrawPreviewLayers();
            // 绘制表单
            SUiDrawArgs args = new SUiDrawArgs();

            args.Context = context;
            if (_designFrame.DesignVisible)
            {
                // 绘制表单
                context.TransformIdentity();
                _designFrame.Draw(args);
                // 绘制下拉部分
                if (args.DropControl != null)
                {
                    context.TransformIdentity();
                    args.DropControl.Draw(args);
                }
            }
            // 绘制辅助器
            if (_selection.HasFocusControl())
            {
                // 绘制辅助线
                DrawAidLines();
                // 绘制辅助器
                _designFrame.DrawDesign(args);
            }
            // 结束绘制
            device.EndDraw();
        }
Пример #2
0
        //============================================================
        // <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);
                }
            }
        }
Пример #3
0
        //============================================================
        // <T>开始绘制处理。</T>
        //
        // @param args 参数
        //============================================================
        public virtual void OnDrawBegin(SUiDrawArgs args)
        {
            FDxContext2d context  = _context.Context;
            FRcControl   resource = ControlResource;

            // 绘制设计背景
            if (_designGround)
            {
                context.FillRectangle(_context.DesignGroundColor.brush, 0, 0, _designSize.Width, _designSize.Height);
            }
            // 绘制后景颜色
            if (resource.BackColor != 0)
            {
                context.FillRectangle(resource.BackColor, 0, 0, _designSize.Width, _designSize.Height);
            }
            // 绘制后景
            DrawResource(_backResource);
        }
Пример #4
0
        //============================================================
        // <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);
        }