本文整理汇总了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);
}
示例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);
}
}
示例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;
}
}
}
}
示例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);
}
}
示例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);
}
示例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);
}
示例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);
}
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
}
示例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);
}
示例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;
}
示例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);
}
示例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);
}
}