• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# Toolkit.RenderContext类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中ComponentFactory.Krypton.Toolkit.RenderContext的典型用法代码示例。如果您正苦于以下问题:C# RenderContext类的具体用法?C# RenderContext怎么用?C# RenderContext使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



RenderContext类属于ComponentFactory.Krypton.Toolkit命名空间,在下文中一共展示了RenderContext类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: RenderBefore

        /// <summary>
        /// Perform rendering before child elements are rendered.
        /// </summary>
        /// <param name="context">Rendering context.</param>
        public override void RenderBefore(RenderContext context)
        {
            IPaletteElementColor elementColors = null;

            switch (State)
            {
                default:
                case PaletteState.Normal:
                    elementColors = _drawTrackBar.StateNormal.Position;
                    break;
                case PaletteState.Disabled:
                    elementColors = _drawTrackBar.StateDisabled.Position;
                    break;
                case PaletteState.Tracking:
                    elementColors = _drawTrackBar.StateTracking.Position;
                    break;
                case PaletteState.Pressed:
                    elementColors = _drawTrackBar.StatePressed.Position;
                    break;
               }

            context.Renderer.RenderGlyph.DrawTrackPositionGlyph(context, State, elementColors, ClientRectangle,
                                                                _drawTrackBar.Orientation,
                                                                _drawTrackBar.TickStyle);
        }
开发者ID:ComponentFactory,项目名称:Krypton,代码行数:29,代码来源:ViewDrawTrackPosition.cs


示例2: DrawInputControlDropDownGlyph

        /// <summary>
        /// Draw a drop down grid appropriate for a input control.
        /// </summary>
        /// <param name="context">Render context.</param>
        /// <param name="cellRect">Available drawing rectangle space.</param>
        /// <param name="paletteContent">Content palette for getting colors.</param>
        /// <param name="state">State associated with rendering.</param>
        public override void DrawInputControlDropDownGlyph(RenderContext context,
                                                           Rectangle cellRect,
                                                           IPaletteContent paletteContent,
                                                           PaletteState state)
        {
            Debug.Assert(context != null);
            Debug.Assert(paletteContent != null);

            // Validate parameter references
            if (context == null) throw new ArgumentNullException("context");
            if (paletteContent == null) throw new ArgumentNullException("paletteContent");

            Color c1 = paletteContent.GetContentShortTextColor1(state);

            // Find the top left starting position for drawing lines
            int xStart = cellRect.Left + (cellRect.Right - cellRect.Left - 4) / 2;
            int yStart = cellRect.Top + (cellRect.Bottom - cellRect.Top - 3) / 2;

            using (Pen darkPen = new Pen(c1))
            {
                context.Graphics.DrawLine(darkPen, xStart, yStart, xStart + 4, yStart);
                context.Graphics.DrawLine(darkPen, xStart + 1, yStart + 1, xStart + 3, yStart + 1);
                context.Graphics.DrawLine(darkPen, xStart + 2, yStart + 2, xStart + 2, yStart + 1);
            }
        }
开发者ID:ComponentFactory,项目名称:Krypton,代码行数:32,代码来源:RenderSparkle.cs


示例3: RenderBefore

        /// <summary>
        /// Perform rendering before child elements are rendered.
        /// </summary>
        /// <param name="context">Rendering context.</param>
        public override void RenderBefore(RenderContext context)
        {
            if (Draw)
            {
                RectangleF rectF = new RectangleF(ClientLocation.X, ClientLocation.Y - 0.5f, ClientWidth, ClientHeight + 1);
                using (LinearGradientBrush sepBrush = new LinearGradientBrush(rectF, Color.Transparent, _palette.GetRibbonTabSeparatorColor(PaletteState.Normal), 90f))
                {
                    sepBrush.Blend = _fadeBlend;

                    switch (_palette.GetRibbonShape())
                    {
                        default:
                        case PaletteRibbonShape.Office2007:
                        case PaletteRibbonShape.Office2013:
                            context.Graphics.FillRectangle(sepBrush, ClientLocation.X + 2, ClientLocation.Y, 1, ClientHeight - 1);
                            break;
                        case PaletteRibbonShape.Office2010:
                            context.Graphics.FillRectangle(sepBrush, ClientLocation.X + 1, ClientLocation.Y, 1, ClientHeight - 1);

                            using (LinearGradientBrush sepLightBrush = new LinearGradientBrush(rectF, Color.Transparent, _lighten1, 90f))
                                context.Graphics.FillRectangle(sepLightBrush, ClientLocation.X + 2, ClientLocation.Y, 1, ClientHeight - 1);
                            break;
                    }
                }
            }
        }
开发者ID:Cocotteseb,项目名称:Krypton,代码行数:30,代码来源:ViewDrawRibbonTabSep.cs


示例4: DrawSeparator

        /// <summary>
        /// Perform drawing of a separator glyph.
        /// </summary>
        /// <param name="context">Render context.</param>
        /// <param name="displayRect">Display area available for drawing.</param>
        /// <param name="paletteBack">Background palette details.</param>
        /// <param name="paletteBorder">Border palette details.</param>
        /// <param name="orientation">Visual orientation of the content.</param>
        /// <param name="state">State associated with rendering.</param>
        /// <param name="canMove">Can the separator be moved.</param>
        public override void DrawSeparator(RenderContext context,
                                           Rectangle displayRect,
                                           IPaletteBack paletteBack,
                                           IPaletteBorder paletteBorder,
                                           Orientation orientation,
                                           PaletteState state,
                                           bool canMove)
        {
            // Let base class perform standard processing
            base.DrawSeparator(context,
                               displayRect,
                               paletteBack,
                               paletteBorder,
                               orientation,
                               state,
                               canMove);

            // If we are drawing the background then draw grab handles on top
            if (paletteBack.GetBackDraw(state) == InheritBool.True)
            {
                // Only draw grab handle if the user can move the separator
                if (canMove)
                    DrawGrabHandleGlyph(context, displayRect, orientation, state);
            }
        }
开发者ID:Cocotteseb,项目名称:Krypton,代码行数:35,代码来源:RenderProfessional.cs


示例5: RenderBefore

 /// <summary>
 /// Perform rendering before child elements are rendered.
 /// </summary>
 /// <param name="context">Rendering context.</param>
 public override void RenderBefore(RenderContext context)
 {
     // Draw the application menu outer background
     _memento = context.Renderer.RenderRibbon.DrawRibbonBack(_ribbon.RibbonShape, context, ClientRectangle, State,
                                                             _ribbon.StateCommon.RibbonAppMenuDocs,
                                                             VisualOrientation.Top, false, _memento);
 }
开发者ID:Cocotteseb,项目名称:Krypton,代码行数:11,代码来源:ViewDrawRibbonAppMenuDocs.cs


示例6: RenderBefore

 /// <summary>
 /// Perform rendering before child elements are rendered.
 /// </summary>
 /// <param name="context">Rendering context.</param>
 public override void RenderBefore(RenderContext context)
 {
     // Use renderer to draw the drop arrow in the provided space
     context.Renderer.RenderGlyph.DrawRibbonDropArrow(_ribbon.RibbonShape,
                                                      context,
                                                      ClientRectangle,
                                                      _ribbon.StateCommon.RibbonGeneral,
                                                      State);
 }
开发者ID:ComponentFactory,项目名称:Krypton,代码行数:13,代码来源:ViewDrawRibbonDropArrow.cs


示例7: RenderBefore

 /// <summary>
 /// Perform rendering before child elements are rendered.
 /// </summary>
 /// <param name="context">Rendering context.</param>
 public override void RenderBefore(RenderContext context)
 {
     using (Pen darkPen = new Pen(_palette.GetRibbonMinimizeBarDark(PaletteState.Normal)),
                lightPen = new Pen(_palette.GetRibbonMinimizeBarLight(PaletteState.Normal)))
     {
         context.Graphics.DrawLine(darkPen, ClientRectangle.Left, ClientRectangle.Bottom - 2, ClientRectangle.Right - 1, ClientRectangle.Bottom - 2);
         context.Graphics.DrawLine(lightPen, ClientRectangle.Left, ClientRectangle.Bottom - 1, ClientRectangle.Right - 1, ClientRectangle.Bottom - 1);
     }
 }
开发者ID:Cocotteseb,项目名称:Krypton,代码行数:13,代码来源:ViewDrawRibbonMinimizeBar.cs


示例8: RenderBefore

        /// <summary>
        /// Perform rendering before child elements are rendered.
        /// </summary>
        /// <param name="context">Rendering context.</param>
        public override void RenderBefore(RenderContext context)
        {
            Debug.Assert(context != null);

            // Validate incoming reference
            if (context == null) throw new ArgumentNullException("context");

            using(SolidBrush brush = new SolidBrush(Color.FromArgb(197, 197, 197)))
                context.Graphics.FillRectangle(brush, ClientRectangle);
        }
开发者ID:Cocotteseb,项目名称:Krypton,代码行数:14,代码来源:ViewDrawMenuColorColumn.cs


示例9: Render

        /// <summary>
        /// Perform a render of the elements.
        /// </summary>
        /// <param name="context">Rendering context.</param>
        public override void Render(RenderContext context)
        {
            Debug.Assert(context != null);

            // Perform rendering before any children
            RenderBefore(context);

            // Perform rendering after that of children
            RenderAfter(context);
        }
开发者ID:ComponentFactory,项目名称:Krypton,代码行数:14,代码来源:ViewLayoutColorStack.cs


示例10: RenderBefore

        /// <summary>
        /// Perform rendering before child elements are rendered.
        /// </summary>
        /// <param name="context">Rendering context.</param>
        public override void RenderBefore(RenderContext context)
        {
            IPaletteElementColor elementColors;
            if (Enabled)
                elementColors = _drawTrackBar.StateNormal.Track;
            else
                elementColors = _drawTrackBar.StateDisabled.Track;

            context.Renderer.RenderGlyph.DrawTrackGlyph(context, State, elementColors, ClientRectangle, _drawTrackBar.Orientation, _drawTrackBar.VolumeControl);
        }
开发者ID:ComponentFactory,项目名称:Krypton,代码行数:14,代码来源:ViewDrawTrackTrack.cs


示例11: RenderBefore

 /// <summary>
 /// Perform rendering before child elements are rendered.
 /// </summary>
 /// <param name="context">Rendering context.</param>
 public override void RenderBefore(RenderContext context)
 {
     // Ask each child to render in turn
     foreach (ViewBase child in this)
     {
         // Only render visible children that are inside the clipping rectangle
         if (child.Visible && child.ClientRectangle.IntersectsWith(context.ClipRect))
             child.RenderBefore(context);
     }
 }
开发者ID:ComponentFactory,项目名称:Krypton,代码行数:14,代码来源:ViewLayoutColorStack.cs


示例12: RenderBefore

        /// <summary>
        /// Perform rendering before child elements are rendered.
        /// </summary>
        /// <param name="context">Rendering context.</param>
        public override void RenderBefore(RenderContext context)
        {
            Debug.Assert(context != null);

            // Validate incoming reference
            if (context == null) throw new ArgumentNullException("context");

            // Ignore renderer, we just draw using solid color for debugging purposes
            using (SolidBrush brush = new SolidBrush(_color))
                context.Graphics.FillRectangle(brush, ClientRectangle);
        }
开发者ID:ComponentFactory,项目名称:Krypton,代码行数:15,代码来源:ViewDrawDebug.cs


示例13: RenderAfter

        /// <summary>
        /// Perform rendering after child elements are rendered.
        /// </summary>
        /// <param name="context">Rendering context.</param>
        public override void RenderAfter(RenderContext context)
        {
            // Ask for another draw of the child but this time only drawing the selected tab
            _layoutTabs.DrawChecked = true;

            // Only render visible children that are inside the clipping rectangle
            if (_layoutOverlap.Visible && _layoutOverlap.ClientRectangle.IntersectsWith(context.ClipRect))
                _layoutOverlap.Render(context);

            _layoutTabs.DrawChecked = false;
        }
开发者ID:ComponentFactory,项目名称:Krypton,代码行数:15,代码来源:ViewLayoutDockerOverlap.cs


示例14: RenderBefore

        /// <summary>
        /// Perform rendering before child elements are rendered.
        /// </summary>
        /// <param name="context">Rendering context.</param>
        public override void RenderBefore(RenderContext context)
        {
            // Let base class perform standard drawing first
            base.RenderBefore(context);

            Rectangle drawRect = new Rectangle(ClientLocation.X,
                                               ClientLocation.Y + ClientWidth,
                                               ClientWidth,
                                               ClientHeight - (ClientWidth * 2));

            context.Renderer.RenderRibbon.DrawRibbonClusterEdge(_ribbon.RibbonShape, context, drawRect, _palette, State);
        }
开发者ID:Cocotteseb,项目名称:Krypton,代码行数:16,代码来源:ViewDrawRibbonGroupClusterEdge.cs


示例15: DrawBackExpertChecked

 /// <summary>
 /// Draw a background for an expert style button that is checked.
 /// </summary>
 /// <param name="context">Rendering context.</param>
 /// <param name="rect">Rectangle to draw.</param>
 /// <param name="backColor1">First color.</param>
 /// <param name="backColor2">Second color.</param>
 /// <param name="orientation">Drawing orientation.</param>
 /// <param name="path">Clipping path.</param>
 /// <param name="memento">Cache used for drawing.</param>
 public static IDisposable DrawBackExpertChecked(RenderContext context,
                                                 Rectangle rect,
                                                 Color backColor1,
                                                 Color backColor2,
                                                 VisualOrientation orientation,
                                                 GraphicsPath path,
                                                 IDisposable memento)
 {
     using (Clipping clip = new Clipping(context.Graphics, path))
     {
         // Draw the expert background which is gradient with highlight at bottom
         return DrawBackExpert(rect, backColor1, backColor2, orientation, context.Graphics, memento, true, false);
     }
 }
开发者ID:ComponentFactory,项目名称:Krypton,代码行数:24,代码来源:RenderExpertHelpers.cs


示例16: RenderBefore

        /// <summary>
        /// Perform rendering before child elements are rendered.
        /// </summary>
        /// <param name="context">Rendering context.</param>
        public override void RenderBefore(RenderContext context)
        {
            Rectangle drawRect = ClientRectangle;

            if (_start)
                drawRect.X -= 4;

            drawRect.Width += 4;

            context.Renderer.RenderGlyph.DrawRibbonGroupSeparator(_ribbon.RibbonShape,
                                                                  context,
                                                                  drawRect,
                                                                  _ribbon.StateCommon.RibbonGeneral,
                                                                  State);
        }
开发者ID:ComponentFactory,项目名称:Krypton,代码行数:19,代码来源:ViewDrawRibbonGroupClusterSeparator.cs


示例17: RenderBefore

        /// <summary>
        /// Perform rendering before child elements are rendered.
        /// </summary>
        /// <param name="context">Rendering context.</param>
        public override void RenderBefore(RenderContext context)
        {
            IPaletteElementColor elementColors;
            if (Enabled)
                elementColors =_drawTrackBar.StateNormal.Tick;
            else
                elementColors = _drawTrackBar.StateDisabled.Tick;

            context.Renderer.RenderGlyph.DrawTrackTicksGlyph(context, State, elementColors, ClientRectangle,
                                                             _drawTrackBar.Orientation, _topRight,
                                                             _drawTrackBar.PositionSize,
                                                             _drawTrackBar.Minimum,
                                                             _drawTrackBar.Maximum,
                                                             _drawTrackBar.TickFrequency);
        }
开发者ID:Cocotteseb,项目名称:Krypton,代码行数:19,代码来源:ViewDrawTrackTicks.cs


示例18: DrawArea

        /// <summary>
        /// Draw a design area with a flap on the left hand edge.
        /// </summary>
        /// <param name="ribbon">Reference to owning ribbon control.</param>
        /// <param name="context">Rendering context.</param>
        /// <param name="clientRect">Client rectangle of the source view.</param>
        /// <param name="state">State of element.</param>
        public static void DrawArea(KryptonRibbon ribbon,
                                    RenderContext context,
                                    Rectangle clientRect,
                                    PaletteState state)
        {
            Color c;

            if (state == PaletteState.Normal)
                c = ribbon.StateCommon.RibbonGeneral.GetRibbonGroupSeparatorDark(PaletteState.Normal);
            else
                c = ribbon.StateCommon.RibbonGroupButton.Back.GetBackColor1(PaletteState.Tracking);

            // Draw entire area in color
            using (SolidBrush darkBrush = new SolidBrush(c))
                context.Graphics.FillRectangle(darkBrush, clientRect);
        }
开发者ID:Cocotteseb,项目名称:Krypton,代码行数:23,代码来源:DesignTimeDraw.cs


示例19: RenderBefore

        /// <summary>
        /// Perform rendering before child elements are rendered.
        /// </summary>
        /// <param name="context">Rendering context.</param>
        public override void RenderBefore(RenderContext context)
        {
            Debug.Assert(context != null);

            // Validate incoming reference
            if (context == null) throw new ArgumentNullException("context");

            // Only draw the shortcut text if there is some defined
            string shortcut = Values.GetShortText();
            if (!string.IsNullOrEmpty(shortcut))
            {
                // Only draw shortcut if the shortcut is not equal to the fixed string 'A'
                if (!shortcut.Equals("A"))
                    base.RenderBefore(context);
            }
        }
开发者ID:ComponentFactory,项目名称:Krypton,代码行数:20,代码来源:ViewDrawRibbonRecentShortcut.cs


示例20: RenderAfter

        /// <summary>
        /// Perform rendering after child elements are rendered.
        /// </summary>
        /// <param name="context">Rendering context.</param>
        public override void RenderAfter(RenderContext context)
        {
            // Do we have a status strip to try and merge?
            if (_statusStrip != null)
            {
                // Is the status strip using the global renderer?
                if (_statusStrip.RenderMode == ToolStripRenderMode.ManagerRenderMode)
                {
                    // Cast to correct type
                    KryptonForm form = context.Control as KryptonForm;

                    if (form != null)
                    {
                        // Find the size of the borders around the form
                        Padding borders = form.RealWindowBorders;

                        // Grab the global renderer to use for painting
                        ToolStripRenderer renderer = ToolStripManager.Renderer;

                        // Size the render strip to the apparent size when merged into borders
                        _renderStrip.Width = form.Width;
                        _renderStrip.Height = _statusStrip.Height + borders.Bottom;

                        // Find vertical start of the status strip
                        int y = _statusStrip.Top + borders.Top;

                        try
                        {
                            // We need to transform downwards from drawing at 0,0 to actual required position
                            context.Graphics.TranslateTransform(0, y);

                            // Use the tool strip renderer to draw the correct status strip border/background
                            renderer.DrawToolStripBorder(new ToolStripRenderEventArgs(context.Graphics, _renderStrip));
                            renderer.DrawToolStripBackground(new ToolStripRenderEventArgs(context.Graphics, _renderStrip));
                        }
                        finally
                        {
                            // Make sure that even a crash in the renderer does not prevent the transform reversal
                            context.Graphics.TranslateTransform(0, -y);
                        }
                    }
                }
            }

            // Finally we let the border be drawn
            base.RenderAfter(context);
        }
开发者ID:ComponentFactory,项目名称:Krypton,代码行数:51,代码来源:ViewDrawForm.cs



注:本文中的ComponentFactory.Krypton.Toolkit.RenderContext类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Toolkit.ViewLayoutContext类代码示例发布时间:2022-05-24
下一篇:
C# Toolkit.PaletteRedirect类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap