当前位置: 首页>>代码示例>>C#>>正文


C# Toolkit.RenderContext类代码示例

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


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


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