本文整理汇总了C#中System.Drawing.Drawing2D.Blend类的典型用法代码示例。如果您正苦于以下问题:C# Blend类的具体用法?C# Blend怎么用?C# Blend使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Blend类属于System.Drawing.Drawing2D命名空间,在下文中一共展示了Blend类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Office2007Renderer
static Office2007Renderer()
{
// One time creation of the blend for the status strip gradient brush
m_statusStripBlend = new Blend();
m_statusStripBlend.Positions = new float[] { 0.0F, 0.2F, 0.3F, 0.4F, 0.8F, 1.0F };
m_statusStripBlend.Factors = new float[] { 0.3F, 0.4F, 0.5F, 1.0F, 0.8F, 0.7F };
}
示例2: KryptonOffice2007Renderer
static KryptonOffice2007Renderer()
{
// One time creation of the blend for the status strip gradient brush
_statusStripBlend = new Blend();
_statusStripBlend.Positions = new float[] { 0.0f, 0.25f, 0.25f, 0.57f, 0.86f, 1.0f };
_statusStripBlend.Factors = new float[] { 0.1f, 0.6f, 1.0f, 0.4f, 0.0f, 0.95f };
}
示例3: PaintValue
public override void PaintValue(PaintValueEventArgs e)
{
if (!(e.Context.Instance is KrbTabControl)) return;
var parent = (KrbTabControl)e.Context.Instance;
var caption = (ButtonsCaption)e.Value;
using (var brush = new LinearGradientBrush(e.Bounds, parent.GradientCaption.InactiveCaptionColorStart, parent.GradientCaption.InactiveCaptionColorEnd, parent.GradientCaption.CaptionGradientStyle))
{
var bl = new Blend(2) { Factors = new[] { 0.1F, 1.0F }, Positions = new[] { 0.0F, 1.0F } };
brush.Blend = bl;
e.Graphics.FillRectangle(brush, e.Bounds);
Image captionDropDown = Resources.DropDown;
using (var attributes = new ImageAttributes())
{
var map = new[]
{
new ColorMap {OldColor = Color.White, NewColor = Color.Transparent},
new ColorMap {OldColor = Color.Black, NewColor = caption.InactiveCaptionButtonsColor}
};
attributes.SetRemapTable(map);
var rect = e.Bounds;
rect.Inflate(-3, 0);
e.Graphics.DrawImage(captionDropDown, rect, 0, 0, captionDropDown.Width, captionDropDown.Height, GraphicsUnit.Pixel, attributes);
}
}
}
示例4: OnRenderMenuItemBackground
/// <summary>
/// 渲染菜单项的背景
/// </summary>
/// <param name="e"></param>
protected override void OnRenderMenuItemBackground(ToolStripItemRenderEventArgs e)
{
if (e.ToolStrip is MenuStrip)
{
//如果被选中或被按下
if (e.Item.Selected || e.Item.Pressed)
{
Blend blend = new Blend();
float[] fs = new float[5] { 0f, 0.3f, 0.5f, 0.8f, 1f };
float[] f = new float[5] { 0f, 0.5f, 1f, 0.5f, 0f };
blend.Positions = fs;
blend.Factors = f;
FillLineGradient(e.Graphics, new Rectangle(0, 0, e.Item.Size.Width, e.Item.Size.Height),
e.Item.Pressed ? colorconfig.DropDownItemBackColor : colorconfig.MenuItemStartColor,
e.Item.Pressed ? colorconfig.DropDownItemBackColor : colorconfig.MenuItemEndColor,
90f, blend);
}
else
base.OnRenderMenuItemBackground(e);
}
else if (e.ToolStrip is ToolStripDropDown)
{
if (e.Item.Selected)
{
FillLineGradient(e.Graphics, new Rectangle(2, 2, e.Item.Size.Width-4, e.Item.Size.Height-4), colorconfig.DropDownItemStartColor, colorconfig.DropDownItemEndColor, 90f, null);
}
}
else
{
base.OnRenderMenuItemBackground(e);
}
}
示例5: PaintVignette
public static void PaintVignette(Graphics g, Rectangle bounds)
{
Rectangle ellipsebounds = bounds;
ellipsebounds.Offset(-ellipsebounds.X, -ellipsebounds.Y);
int x = ellipsebounds.Width - (int)Math.Round(.70712 * ellipsebounds.Width);
int y = ellipsebounds.Height - (int)Math.Round(.70712 * ellipsebounds.Height);
ellipsebounds.Inflate(x, y);
using (GraphicsPath path = new GraphicsPath())
{
path.AddEllipse(ellipsebounds);
using (PathGradientBrush brush = new PathGradientBrush(path))
{
brush.WrapMode = WrapMode.Tile;
brush.CenterColor = Color.FromArgb(0, 0, 0, 0);
brush.SurroundColors = new Color[] { Color.FromArgb(255, 0, 0, 0) };
Blend blend = new Blend();
blend.Positions = new float[] { 0.0f, 0.2f, 0.4f, 0.6f, 0.8f, 1.0F };
blend.Factors = new float[] { 0.0f, 0.5f, 1f, 1f, 1.0f, 1.0f };
brush.Blend = blend;
Region oldClip = g.Clip;
g.Clip = new Region(bounds);
g.FillRectangle(brush, ellipsebounds);
g.Clip = oldClip;
}
}
}
示例6: KryptonSparkleRenderer
static KryptonSparkleRenderer()
{
// One time creation of the blend for the status strip gradient brush
_statusStripBlend = new Blend();
_statusStripBlend.Factors = new float[] { 0.0f, 0.0f, 0.0f, 1.0f };
_statusStripBlend.Positions = new float[] { 0.0f, 0.33f, 0.33f, 1.0f };
}
示例7: VS2005MultithreadingDockPaneCaption
public VS2005MultithreadingDockPaneCaption(DockPane pane)
: base(pane)
{
SuspendLayout();
m_components = new Container();
m_toolTip = new ToolTip(Components);
// clone shared resources
lock (typeof(Resources))
{
_imageButtonAutoHide = (Bitmap)Resources.DockPane_AutoHide.Clone();
_imageButtonClose = (Bitmap)Resources.DockPane_Close.Clone();
_imageButtonDock = (Bitmap)Resources.DockPane_Dock.Clone();
_imageButtonOptions = (Bitmap)Resources.DockPane_Option.Clone();
}
// create background blend
_activeBackColorGradientBlend = new Blend(2)
{
Factors = new float[] { 0.5F, 1.0F },
Positions = new float[] { 0.0F, 1.0F },
};
ResumeLayout();
}
示例8: ViewDrawRibbonTab
static ViewDrawRibbonTab()
{
_contextBlend2007 = new Blend();
_contextBlend2007.Factors = new float[] { 0.0f, 0.0f, 1.0f, 1.0f };
_contextBlend2007.Positions = new float[] { 0.0f, 0.41f, 0.7f, 1.0f };
_contextBlend2010 = new Blend();
_contextBlend2010.Factors = new float[] { 0.0f, 1.0f, 1.0f };
_contextBlend2010.Positions = new float[] { 0.0f, 0.6f, 1.0f };
}
示例9: RenderExpertHelpers
static RenderExpertHelpers()
{
_rounded1Blend = new Blend();
_rounded1Blend.Positions = new float[] { 0.0f, 0.1f, 1.0f };
_rounded1Blend.Factors = new float[] { 0.0f, 1.0f, 1.0f };
_rounded2Blend = new Blend();
_rounded2Blend.Positions = new float[] { 0.0f, 0.50f, 0.75f, 1.0f };
_rounded2Blend.Factors = new float[] { 0.0f, 1.0f, 1.0f, 1.0f };
}
示例10: createFluffyBrush
public static Brush createFluffyBrush(GraphicsPath gp, float[] blendPositions, float[] blendFactors )
{
PathGradientBrush pgb = new PathGradientBrush( gp );
Blend blend = new Blend();
blend.Positions = blendPositions;
blend.Factors = blendFactors;
pgb.Blend = blend;
pgb.CenterColor = Color.White;
pgb.SurroundColors = new Color[] { Color.Black };
return pgb;
}
示例11: GetBackgroundBlend
private static Blend GetBackgroundBlend(){
float[] relativeIntensities = new float[]{0f, 0.5f, 1f, 1f};
float[] relativePositions = new float[]{0f, 0.5f, 0.51f, 1f};
Blend blend = new Blend();
blend.Factors = relativeIntensities;
blend.Positions = relativePositions;
return blend;
}
示例12: ThemeNice
public ThemeNice( )
{
ColorControl = NiceBackColor;
FlatBlend = new Blend ();
FlatBlend.Factors = new float []{0.0f, 0.992f, 1.0f};
FlatBlend.Positions = new float []{0.0f, 0.68f, 1.0f};
NormalBlend = new Blend ();
NormalBlend.Factors = new float []{0.0f, 0.008f, 1.0f};
NormalBlend.Positions = new float []{0.0f, 0.32f, 1.0f};
}
示例13: TransformImage
/// <summary>
/// Processes the image.
/// </summary>
/// <param name="factory">
/// The the current instance of the <see cref="T:ImageProcessor.ImageFactory"/> class containing
/// the image to process.
/// </param>
/// <param name="image">The current image to process</param>
/// <param name="newImage">The new Image to return</param>
/// <returns>
/// The processed image from the current instance of the <see cref="T:ImageProcessor.ImageFactory"/> class.
/// </returns>
public Image TransformImage(ImageFactory factory, Image image, Image newImage)
{
using (Graphics graphics = Graphics.FromImage(newImage))
{
using (ImageAttributes attributes = new ImageAttributes())
{
attributes.SetColorMatrix(this.Matrix);
Rectangle rectangle = new Rectangle(0, 0, image.Width, image.Height);
graphics.DrawImage(image, rectangle, 0, 0, image.Width, image.Height, GraphicsUnit.Pixel, attributes);
// Add a glow to the image.
using (GraphicsPath path = new GraphicsPath())
{
path.AddEllipse(rectangle);
using (PathGradientBrush brush = new PathGradientBrush(path))
{
// Fill a rectangle with an elliptical gradient brush that goes from orange to transparent.
// This has the effect of painting the far corners transparent and fading in to orange on the
// way in to the centre.
brush.WrapMode = WrapMode.Tile;
brush.CenterColor = Color.FromArgb(70, 255, 153, 102);
brush.SurroundColors = new Color[] { Color.FromArgb(0, 0, 0, 0) };
Blend blend = new Blend
{
Positions = new float[] { 0.0f, 0.2f, 0.4f, 0.6f, 0.8f, 1.0F },
Factors = new float[] { 0.0f, 0.5f, 1f, 1f, 1.0f, 1.0f }
};
brush.Blend = blend;
Region oldClip = graphics.Clip;
graphics.Clip = new Region(rectangle);
graphics.FillRectangle(brush, rectangle);
graphics.Clip = oldClip;
}
}
}
}
// Add a vignette to finish the effect.
factory.Update(newImage);
Vignette vignette = new Vignette();
newImage = (Bitmap)vignette.ProcessImage(factory);
// Reassign the image.
image.Dispose();
image = newImage;
return image;
}
示例14: PaintValue
public override void PaintValue(PaintValueEventArgs e)
{
CaptionGradient gradient = e.Value as CaptionGradient;
using (LinearGradientBrush brush = new LinearGradientBrush(e.Bounds, gradient.InactiveCaptionColorStart, gradient.InactiveCaptionColorEnd, gradient.CaptionGradientStyle))
{
Blend bl = new Blend(2);
bl.Factors = new float[] { 0.1F, 1.0F };
bl.Positions = new float[] { 0.0F, 1.0F };
brush.Blend = bl;
e.Graphics.FillRectangle(brush, e.Bounds);
}
}
示例15: InitializeBlends
private void InitializeBlends()
{
this.ActiveTabBlend = new Blend();
this.ActiveTabBlend.Factors = new float[] { 0.3f, 0.4f, 0.5f, 1f, 1f };
this.ActiveTabBlend.Positions = new float[] { 0f, 0.2f, 0.35f, 0.35f, 1f };
this.InactiveTabBlend = new Blend();
this.InactiveTabBlend.Factors = new float[] { 0.3f, 0.4f, 0.5f, 1f, 0.8f, 0.7f };
this.InactiveTabBlend.Positions = new float[] { 0f, 0.2f, 0.4f, 0.4f, 0.8f, 1f };
this.ShadowBlend = new Blend();
this.ShadowBlend.Factors = new float[] { 0f, 0.1f, 0.3f, 0.4f };
this.ShadowBlend.Positions = new float[] { 0f, 0.5f, 0.8f, 1f };
}