本文整理汇总了C#中Genetibase.Shared.Controls.NuGenPaintParams类的典型用法代码示例。如果您正苦于以下问题:C# NuGenPaintParams类的具体用法?C# NuGenPaintParams怎么用?C# NuGenPaintParams使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
NuGenPaintParams类属于Genetibase.Shared.Controls命名空间,在下文中一共展示了NuGenPaintParams类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OnPaint
/// <summary>
/// Add custom logic before the <see cref="E:Genetibase.Shared.Windows.NuGenWndLessControl.Paint"/> event will be raised.
/// </summary>
/// <param name="e"></param>
protected override void OnPaint(PaintEventArgs e)
{
NuGenPaintParams paintParams = new NuGenPaintParams(e.Graphics);
paintParams.Bounds = this.Bounds;
paintParams.State = this.ButtonStateTracker.GetControlState();
this.Renderer.DrawDropDownButton(paintParams);
}
示例2: DrawCCWRotateButton
/// <summary>
/// </summary>
/// <param name="paintParams"></param>
/// <exception cref="ArgumentNullException">
/// <para><paramref name="paintParams"/> is <see langword="null"/>.</para>
/// </exception>
public void DrawCCWRotateButton(NuGenPaintParams paintParams)
{
if (paintParams == null)
{
throw new ArgumentNullException("paintParams");
}
NuGenImagePaintParams imagePaintParams = new NuGenImagePaintParams(paintParams);
switch (imagePaintParams.State)
{
case NuGenControlState.Hot:
case NuGenControlState.Pressed:
{
imagePaintParams.Image = res.RotateCCW_Hot;
break;
}
default:
{
imagePaintParams.Image = res.RotateCCW_Normal;
break;
}
}
this.DrawImage(imagePaintParams);
}
示例3: DrawDropDownArrow
/// <summary>
/// </summary>
/// <param name="paintParams"></param>
/// <exception cref="ArgumentNullException">
/// <para><paramref name="paintParams"/> is <see langword="null"/>.</para>
/// </exception>
public void DrawDropDownArrow(NuGenPaintParams paintParams)
{
if (paintParams == null)
{
throw new ArgumentNullException("paintParams");
}
Graphics g = paintParams.Graphics;
Rectangle bounds = paintParams.Bounds;
NuGenControlState state = paintParams.State;
int x = bounds.Left + bounds.Width / 2;
int y = bounds.Top + bounds.Height / 2 - 3;
Point[] arrowPoints = new Point[] {
new Point(x - 3, y),
new Point(x + 2, y),
new Point(x, y + 3)
};
using (SolidBrush sb = new SolidBrush(this.ColorManager.GetBorderColor(state)))
{
PixelOffsetMode oldPixelOffsetMode = g.PixelOffsetMode;
g.PixelOffsetMode = PixelOffsetMode.HighQuality;
g.FillPolygon(sb, arrowPoints);
g.PixelOffsetMode = oldPixelOffsetMode;
}
}
示例4: DrawDoubleScrollButton
/// <summary>
/// </summary>
/// <param name="paintParams"></param>
/// <exception cref="ArgumentNullException">
/// <para><paramref name="paintParams"/> is <see langword="null"/>.</para>
/// </exception>
public void DrawDoubleScrollButton(NuGenPaintParams paintParams)
{
if (paintParams == null)
{
throw new ArgumentNullException("paintParams");
}
this.DrawBackground(paintParams);
this.DrawBorder(paintParams);
Rectangle bounds = paintParams.Bounds;
paintParams.Bounds = new Rectangle(
bounds.Left
, bounds.Top - 3
, bounds.Width
, bounds.Height
);
this.DrawScrollButtonBody(paintParams);
paintParams.Bounds = new Rectangle(
bounds.Left
, bounds.Top + 3
, bounds.Width
, bounds.Height
);
this.DrawScrollButtonBody(paintParams);
}
示例5: OnPaint
protected override void OnPaint(PaintEventArgs e)
{
NuGenPaintParams paintParams = new NuGenPaintParams(e.Graphics);
paintParams.Bounds = this.ClientRectangle;
paintParams.State = this.StateTracker.GetControlState();
this.Renderer.DrawToolBarSeparator(paintParams);
}
示例6: DrawExtendedBackground
/// <summary>
/// </summary>
/// <param name="paintParams"></param>
/// <exception cref="ArgumentNullException">
/// <para><paramref name="paintParams"/> is <see langword="null"/>.</para>
/// </exception>
public void DrawExtendedBackground(NuGenPaintParams paintParams)
{
if (paintParams == null)
{
throw new ArgumentNullException("paintParams");
}
this.DrawBackground(paintParams);
Color borderColor = this.ColorManager.GetBorderColor(paintParams.State);
Graphics g = paintParams.Graphics;
Rectangle bounds = paintParams.Bounds;
int ellipseWidth = 2 * bounds.Width;
int ellipseHeight = 2 * bounds.Height;
int ellipseStart = 0;
int ellipseStep = 50;
using (SolidBrush sb = new SolidBrush(Color.FromArgb(20, borderColor)))
{
g.FillEllipse(sb, ellipseStart, ellipseStart, ellipseWidth, ellipseHeight);
g.FillEllipse(sb, ellipseStart + ellipseStep, ellipseStart + ellipseStep, ellipseWidth, ellipseHeight);
g.FillEllipse(sb, ellipseStart + ellipseStep * 2, ellipseStart + ellipseStep * 2, ellipseWidth, ellipseHeight);
}
}
示例7: ArgumentNullException
void INuGenRoundedPanelRenderer.DrawBackground(NuGenPaintParams paintParams)
{
if (paintParams == null)
{
throw new ArgumentNullException("paintParams");
}
base.DrawRoundBackground(paintParams);
Graphics g = paintParams.Graphics;
Rectangle bounds = paintParams.Bounds;
NuGenControlState state = paintParams.State;
RectangleF ellipseBounds = new RectangleF(
bounds.Left - bounds.Width * 0.2f
, bounds.Top + bounds.Height * 0.6f
, bounds.Width * 2
, bounds.Height
);
if (ellipseBounds.Width > 0 && ellipseBounds.Height > 0)
{
Color beginColor = Color.FromArgb(60, this.ColorManager.GetBorderColor(state));
Color endColor = Color.FromArgb(10, this.ColorManager.GetBackgroundGradientEnd(state));
using (Brush brush = new LinearGradientBrush(ellipseBounds, beginColor, endColor, 0.0f))
{
g.SetClip(bounds, CombineMode.Replace);
g.FillEllipse(brush, ellipseBounds);
}
}
}
示例8: DrawShadow
/// <summary>
/// </summary>
/// <param name="paintParams"></param>
public void DrawShadow(NuGenPaintParams paintParams)
{
if (paintParams == null)
{
throw new ArgumentNullException("paintParams");
}
Graphics g = paintParams.Graphics;
Rectangle bounds = paintParams.Bounds;
int alpha = 0;
Color baseColor = Color.Black;
int alphaStep = 5;
Padding deflatePadding = new Padding(1);
using (NuGenGrfxMode mode = new NuGenGrfxMode(g))
{
NuGenControlPaint.SetGraphicsVeryHighQuality(g);
using (Pen pen = new Pen(Color.FromArgb(alpha, baseColor)))
{
for (int i = 0; i <= _shadowStepCount; i++)
{
g.DrawRectangle(pen, bounds);
pen.Color = Color.FromArgb(alpha += alphaStep, baseColor);
bounds = NuGenControlPaint.DeflateRectangle(bounds, deflatePadding);
if (i == 1)
{
alphaStep = 10;
}
}
}
}
}
示例9: DrawBorder
/// <summary>
/// </summary>
/// <param name="paintParams"></param>
public void DrawBorder(NuGenPaintParams paintParams)
{
base.DrawBorder(
paintParams.Graphics
, NuGenControlPaint.BorderRectangle(paintParams.Bounds)
, paintParams.State
);
}
示例10: DrawBorder
/// <summary>
/// </summary>
/// <param name="paintParams"></param>
/// <exception cref="ArgumentNullException"><paramref name="paintParams"/> is <see langword="null"/>.</exception>
public void DrawBorder(NuGenPaintParams paintParams)
{
if (paintParams == null)
{
throw new ArgumentNullException("paintParams");
}
base.DrawBorder(paintParams.Graphics, paintParams.Bounds, paintParams.State);
}
示例11: DrawShadow
/*
* DrawShadow
*/
/// <summary>
/// </summary>
/// <param name="paintParams"></param>
public void DrawShadow(NuGenPaintParams paintParams)
{
if (paintParams == null)
{
throw new ArgumentNullException("paintParams");
}
this.DrawShadow(paintParams.Graphics, NuGenSmoothButtonRenderer.GetBorderRectangle(paintParams.Bounds), paintParams.State);
}
示例12: DrawBorder
/// <summary>
/// </summary>
/// <param name="paintParams"></param>
/// <exception cref="ArgumentNullException">
/// <para>
/// <paramref name="paintParams"/> is <see langword="null"/>.
/// </para>
/// </exception>
public void DrawBorder(NuGenPaintParams paintParams)
{
if (paintParams == null)
{
throw new ArgumentNullException("paintParams");
}
this.DrawBorder(paintParams.Graphics, NuGenControlPaint.BorderRectangle(paintParams.Bounds), paintParams.State);
}
示例13: DrawComboBoxButton
/*
* DrawComboBoxButton
*/
/// <summary>
/// </summary>
/// <param name="paintParams"></param>
/// <exception cref="ArgumentNullException">
/// <para><paramref name="paintParams"/> is <see langword="null"/>.</para>
/// </exception>
/// <exception cref="InvalidOperationException">
/// <para>
/// Border should return an array containing at least 1 element.
/// </para>
/// </exception>
public void DrawComboBoxButton(NuGenPaintParams paintParams)
{
if (paintParams == null)
{
throw new ArgumentNullException("paintParams");
}
this.DrawScrollButton(paintParams);
}
示例14: DrawDropDownButton
/// <summary>
/// </summary>
/// <param name="paintParams"></param>
/// <exception cref="ArgumentNullException"><para><paramref name="paintParams"/> is <see langword="null"/>.</para></exception>
public void DrawDropDownButton(NuGenPaintParams paintParams)
{
if (paintParams == null)
{
throw new ArgumentNullException("paintParams");
}
this.DrawScrollButtonBody(paintParams);
}
示例15: DrawBackground
/*
* DrawBackground
*/
/// <summary>
/// </summary>
/// <param name="paintParams"></param>
/// <exception cref="ArgumentNullException"><paramref name="paintParams"/> is <see langword="null"/>.</exception>
public new void DrawBackground(NuGenPaintParams paintParams)
{
if (paintParams == null)
{
throw new ArgumentNullException("paintParams");
}
base.DrawRoundBackground(paintParams);
}