本文整理汇总了C#中LinearGradientMode类的典型用法代码示例。如果您正苦于以下问题:C# LinearGradientMode类的具体用法?C# LinearGradientMode怎么用?C# LinearGradientMode使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
LinearGradientMode类属于命名空间,在下文中一共展示了LinearGradientMode类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: LinearGradientBrush
public LinearGradientBrush (RectangleF rect, Color color1, Color color2, LinearGradientMode linearGradientMode)
{
Status status = GDIPlus.GdipCreateLineBrushFromRect (ref rect, color1.ToArgb (), color2.ToArgb (), linearGradientMode, WrapMode.Tile, out nativeObject);
GDIPlus.CheckStatus (status);
rectangle = rect;
}
开发者ID:nlhepler,项目名称:mono,代码行数:7,代码来源:LinearGradientBrush.cs
示例2: HeaderPanel
public HeaderPanel()
: base()
{
InitializeComponent();
this.Font = new Font(SystemFonts.CaptionFont,
SystemFonts.CaptionFont.Style);
this.mfnt_CaptionFont = this.Font;
this.mstr_CaptionText = this.GetType().Name;
this.mint_CaptionHeight = SystemInformation.CaptionHeight;
this.mclr_CaptionBeginColor = Color.FromKnownColor(KnownColor.InactiveCaption);
this.mclr_CaptionEndColor = Color.FromKnownColor(KnownColor.ActiveCaption);
this.menm_CaptionGradientMode = LinearGradientMode.Vertical;
this.menm_CaptionPosition = HeaderPanelCaptionPositions.Top;
this.menm_BorderStyle = HeaderPanelBorderStyles.Shadow;
base.BorderStyle = 0;
this.mclr_BorderColor = Color.FromKnownColor(KnownColor.ActiveCaption);
this.mclr_StartColor = Color.FromKnownColor(KnownColor.Window);
this.mclr_EndColor = Color.FromKnownColor(KnownColor.Window);
this.menm_GradientMode = LinearGradientMode.Vertical;
this.SetStyle(ControlStyles.ResizeRedraw, true);
this.SetStyle(ControlStyles.UserPaint, true);
this.SetStyle(ControlStyles.AllPaintingInWmPaint, true);
this.SetStyle(ControlStyles.DoubleBuffer, true);
}
开发者ID:zhuangyy,项目名称:Motion,代码行数:29,代码来源:HeaderPanel.cs
示例3: GradientStyle
public GradientStyle(Color light, Color dark, LinearGradientMode mode)
{
Type = GradientType.LinearGradientMode;
FirstColor = dark;
SecondColor = light;
GradMode = mode;
}
开发者ID:nocmnt,项目名称:UVA-Arena,代码行数:7,代码来源:Stylish.cs
示例4: Init
private void Init(float x1, float y1, Color color1, float x2, float y2, Color color2, LinearGradientMode linearGradientMode) {
_gradientRectangle = new RectangleF(x1, y1, x2-x1, y2-y1);
PointF [] points;
switch (linearGradientMode) {
case LinearGradientMode.Horizontal :
Init(x1, y1, color1, x2, y1, color2, false);
break;
case LinearGradientMode.Vertical :
Init(x1, y1, color1, x1, y2, color2, false);
break;
case LinearGradientMode.BackwardDiagonal :
points = GetMedianeEnclosingRect(x1, y1, x2, y2, false);
Init(points[0].X, points[0].Y, color2, points[1].X, points[1].Y, color1, false);
break;
case LinearGradientMode.ForwardDiagonal :
points = GetMedianeEnclosingRect(x1, y1, x2, y2, true);
Init(points[0].X, points[0].Y, color1, points[1].X, points[1].Y, color2, false);
break;
default :
throw new ArgumentException("LinearGradientMode");
}
}
开发者ID:calumjiao,项目名称:Mono-Class-Libraries,代码行数:27,代码来源:LinearGradientBrush.jvm.cs
示例5: Form1
public Form1()
{
InitializeComponent();
logPanel = new loginPanel();
logPanel.Parent = this;
logPanel.Dock = DockStyle.Fill;
this.Controls.Add(logPanel);
this.menuStrip1.Visible = false;
this.splitContainer1.Visible = false;
logPanel.Button.Click += new EventHandler(Button_Click);
logPanel.PassBox.KeyPress+=new KeyPressEventHandler(PassBox_KeyPress);
this.GradientColorOne = Color.Indigo;
this.GradientColorTwo = Color.Navy;
this.lgm = LinearGradientMode.ForwardDiagonal;
currentPath = Path.GetDirectoryName( Application.ExecutablePath);
absolutePath = Path.Combine(currentPath,relativePath);
connectionString = string.Format("Provider=Microsoft.Jet.OLEDB.4.0;Data source={0}", absolutePath);
connection = new OleDbConnection(connectionString);
cmpIgrac1 = new cmpIgrac();
System.Threading.Thread.Sleep(200);
cmpIgrac2 = new cmpIgrac();
cmpOneGB.Text = cmpIgrac1.Ime.ToUpper();
cmpTwoGB.Text = cmpIgrac2.Ime.ToUpper();
cmpOneBodovi._Text = string.Format("{0}",0);
cmpTwoBodovi._Text = string.Format("{0}",0);
}
开发者ID:dangji,项目名称:Kvisko,代码行数:31,代码来源:Form1.cs
示例6: RenderBackgroundInternal
internal static void RenderBackgroundInternal(
Graphics g,
Rectangle rect,
Color baseColor,
Color borderColor,
Color innerBorderColor,
RoundStyle style,
int roundWidth,
bool drawBorder,
bool drawGlass,
LinearGradientMode mode)
{
RenderBackgroundInternal(
g,
rect,
baseColor,
borderColor,
innerBorderColor,
style,
8,
0.45f,
drawBorder,
drawGlass,
mode);
}
开发者ID:GarnettLuo,项目名称:XiaoCai.WinformUI,代码行数:25,代码来源:RenderHelper.cs
示例7: BrushParameter
public BrushParameter()
{
_color1 = Color.Black;
_color2 = Color.Empty;
_mode = LinearGradientMode.Vertical;
}
开发者ID:JackWangCUMT,项目名称:winform-control-lib,代码行数:7,代码来源:BrushParameter.cs
示例8: FillWithDoubleGradient
private void FillWithDoubleGradient(Color beginColor, Color middleColor, Color endColor, Graphics g, Rectangle bounds, int firstGradientWidth, int secondGradientWidth, LinearGradientMode mode, bool flipHorizontal)
{
if ((bounds.Width != 0) && (bounds.Height != 0))
{
Rectangle rect = bounds;
Rectangle rectangle2 = bounds;
bool flag = true;
if (mode == LinearGradientMode.Horizontal)
{
if (flipHorizontal)
{
Color color = endColor;
endColor = beginColor;
beginColor = color;
}
rectangle2.Width = firstGradientWidth;
rect.Width = secondGradientWidth + 1;
rect.X = bounds.Right - rect.Width;
flag = bounds.Width > (firstGradientWidth + secondGradientWidth);
}
else
{
rectangle2.Height = firstGradientWidth;
rect.Height = secondGradientWidth + 1;
rect.Y = bounds.Bottom - rect.Height;
flag = bounds.Height > (firstGradientWidth + secondGradientWidth);
}
if (flag)
{
using (Brush brush = new SolidBrush(middleColor))
{
g.FillRectangle(brush, bounds);
}
using (Brush brush2 = new LinearGradientBrush(rectangle2, beginColor, middleColor, mode))
{
g.FillRectangle(brush2, rectangle2);
}
using (LinearGradientBrush brush3 = new LinearGradientBrush(rect, middleColor, endColor, mode))
{
if (mode == LinearGradientMode.Horizontal)
{
rect.X++;
rect.Width--;
}
else
{
rect.Y++;
rect.Height--;
}
g.FillRectangle(brush3, rect);
return;
}
}
using (Brush brush4 = new LinearGradientBrush(bounds, beginColor, endColor, mode))
{
g.FillRectangle(brush4, bounds);
}
}
}
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:59,代码来源:ToolStripProfessionalRenderer.cs
示例9: drawGrad
public static void drawGrad(Color c1, Color c2, Rectangle rect, Graphics gr2, LinearGradientMode lgw)
{
using (LinearGradientBrush lgb = new
LinearGradientBrush(rect,
c1, c2, lgw))
gr2.FillRectangle(lgb, rect);
}
开发者ID:andrewjc,项目名称:sqlconsole,代码行数:8,代码来源:grads.cs
示例10: GradientTab
public GradientTab(Color first, Color second, LinearGradientMode lnrMode, Color textColor, Color selectedTextColor, FontStyle fontStyle)
{
_colorStart = first;
_colorEnd = second;
_gradientStyle = lnrMode;
_tabPageTextColor = textColor;
_tabPageSelectedTextColor = selectedTextColor;
_selectedTabFontStyle = fontStyle;
}
开发者ID:KelvinCoding,项目名称:masterwork-dwarf-fortress,代码行数:9,代码来源:GradientTab.cs
示例11: MyGradientStyle
public MyGradientStyle(Color primaryColor, Color secondaryColor, LinearGradientMode gradientMode)
{
this.primaryColor = primaryColor;
this.secondaryColor = secondaryColor;
this.gradientMode = gradientMode;
Rectangle initialRectangle = new Rectangle(0, 0, 1, 1);
CreateGradient(initialRectangle);
}
开发者ID:pchmielowski,项目名称:Paint,代码行数:9,代码来源:Style.cs
示例12: LinearGradientBrush
public LinearGradientBrush(RectangleF rect, Color color1, Color color2,
LinearGradientMode linearGradientMode)
{
this.rect = rect;
this.color1 = color1;
this.color2 = color2;
this.mode = linearGradientMode;
this.angle = 0.0f;
this.isAngleScaleable = false;
}
开发者ID:jjenki11,项目名称:blaze-chem-rendering,代码行数:10,代码来源:LinearGradientBrush.cs
示例13: SafelyDrawLinearGradient
public static void SafelyDrawLinearGradient(Rectangle rectangle, Color startColor, Color endColor,
LinearGradientMode mode, Graphics graphics)
{
if (rectangle.Width > 0 && rectangle.Height > 0)
{
using (LinearGradientBrush brush = new LinearGradientBrush(rectangle, startColor, endColor, mode))
{
graphics.FillRectangle(brush, rectangle);
}
}
}
开发者ID:460189852,项目名称:dockpanelsuite,代码行数:11,代码来源:DrawingRoutines.cs
示例14: CaptionGradient
public CaptionGradient(Color firstActive, Color secondActive, Color firstInactive, Color secondInactive, LinearGradientMode lnrMode,
Color activeTextColor, Color inactiveTextColor, FontStyle fontStyle)
{
_activeCaptionColorStart = firstActive;
_activeCaptionColorEnd = secondActive;
_inactiveCaptionColorStart = firstInactive;
_inactiveCaptionColorEnd = secondInactive;
_captionGradientStyle = lnrMode;
_activeCaptionTextColor = activeTextColor;
_inactiveCaptionTextColor = inactiveTextColor;
_activeCaptionFontStyle = fontStyle;
}
开发者ID:KelvinCoding,项目名称:masterwork-dwarf-fortress,代码行数:12,代码来源:CaptionGradient.cs
示例15: SetDataSource
void SetDataSource(LinearGradientMode selected)
{
this.BeginUpdate();
Items.Clear();
foreach (LinearGradientMode o in Enum.GetValues(typeof(LinearGradientMode)))
Items.Add(o);
SelectedItem = selected;
this.EndUpdate();
}
开发者ID:Altaxo,项目名称:Altaxo,代码行数:12,代码来源:LinearGradientModeComboBox.cs
示例16: FillRoundedRectangle
/// <summary>
/// Dibuja un rectángulo redondeado con un gradiante
/// </summary>
public static void FillRoundedRectangle(Graphics grpCanvas, int intLeft, int intTop, int intWidth, int intHeight,
int intArcWidth, int intArcAngle,
Color clrBackground, Color clrGradient, LinearGradientMode intMode,
Pen penBorder)
{ using (GraphicsPath pthRectangle = GetRoundedPath(intLeft, intTop, intWidth, intHeight, intArcWidth, intArcAngle))
using (LinearGradientBrush brsGradient = new LinearGradientBrush(new Rectangle(0, 0, intWidth, intHeight),
clrBackground, clrGradient, intMode))
{ // Dibuja el rectángulo con su fondo
grpCanvas.FillPath(brsGradient, pthRectangle);
// Dibuja el borde
grpCanvas.DrawPath(penBorder, pthRectangle);
}
}
开发者ID:jbautistam,项目名称:BauXmppMessenger,代码行数:16,代码来源:clsHelperDrawing.cs
示例17: DrawGradient
private Bitmap DrawGradient(Color fromColor, Color toColor, LinearGradientMode gradientMode)
{
Bitmap bmp = new Bitmap(Width, Height);
Rectangle rect = new Rectangle(0, 0, bmp.Width, bmp.Height);
using (Graphics g = Graphics.FromImage(bmp))
using (LinearGradientBrush brush = new LinearGradientBrush(rect, fromColor, toColor, gradientMode))
{
g.FillRectangle(brush, rect);
}
return bmp;
}
开发者ID:barsv,项目名称:ShareX,代码行数:13,代码来源:MonitorTestForm.cs
示例18: FillBackground
/// <summary>
/// Fills the specified <paramref name="path"/> either with a gradient background or a solid one.
/// </summary>
/// <param name="g">The <see cref="Graphics"/> object used to draw.</param>
/// <param name="path">The <see cref="GraphicsPath"/> to fill.</param>
/// <param name="colorStart">The start color.</param>
/// <param name="colorEnd">The end color if drawing a gradient background.</param>
/// <param name="mode">The <see cref="LinearGradientMode"/> to use.</param>
/// <exception cref="ArgumentNullException">If <paramref name="path"/> is null.</exception>
public static void FillBackground(
Graphics g,
GraphicsPath path,
Color colorStart,
Color colorEnd,
LinearGradientMode? mode)
{
if (path == null)
{
throw new ArgumentNullException("path", "parameter 'path' cannot be null.");
}
RectangleF rect = path.GetBounds();
if (!CheckParams(g, path.GetBounds()) || colorStart == Color.Empty)
{
return;
}
if (colorEnd == Color.Empty)
{
if (colorStart != Color.Transparent)
{
using (SolidBrush brush = new SolidBrush(colorStart))
{
g.FillPath(brush, path);
}
}
}
else
{
rect.Height += 2;
rect.Y--;
using (LinearGradientBrush brush = new LinearGradientBrush(
rect,
colorStart,
colorEnd,
mode.GetValueOrDefault(LinearGradientMode.Vertical)))
{
g.FillPath(brush, path);
}
}
}
开发者ID:sulerzh,项目名称:DbExporter,代码行数:53,代码来源:MonthCalendarAbstractRenderer.cs
示例19: KeyboardRectangle
/// <summary>
/// Represents a Rectangle on the keyboard which can be drawn to a Bitmap.
/// By default, a rectangle is the entire keyboard's size.
/// </summary>
/// <param name="keyboard">The keyboard this rectangle will be used for</param>
/// <param name="x"></param>
/// <param name="y"></param>
/// <param name="colors">An array of colors the ColorBlend will use</param>
/// <param name="gradientMode"></param>
public KeyboardRectangle(KeyboardProvider keyboard, int x, int y, List<Color> colors,
LinearGradientMode gradientMode)
{
_keyboard = keyboard;
_rotationProgress = 0;
_blinkWorker.DoWork += BlinkWorker_DoWork;
Scale = 4;
X = x;
Y = y;
Width = keyboard.Width*Scale;
Height = keyboard.Height*Scale;
Visible = true;
Opacity = 255;
ContainedBrush = true;
GradientMode = gradientMode;
Rotate = false;
LoopSpeed = 1;
Colors = colors;
}
开发者ID:SpoinkyNL,项目名称:Artemis,代码行数:30,代码来源:KeyboardRectangle.cs
示例20: Shape
// Methods
public Shape()
{
base.Paint += new PaintEventHandler(this.Shape_Paint);
this._Corners = new CornersProperty();
this._FocalPoints = new cFocalPoints(0.5, 0.5, 0.0, 0.0);
this._BorderStyle = DashStyle.Solid;
this._RadiusInner = 0f;
this._BorderShow = true;
this._BorderWidth = 2f;
this._ColorFillSolid = SystemColors.Control;
Color[] S0 = new Color[] { Color.White, Color.White };
this._ColorFillBlend = new cBlendItems(S0, new float[] { 0f, 1f });
this._FillType = eFillType.Solid;
this._FillTypeLinear = LinearGradientMode.Horizontal;
this._BorderColor = Color.Black;
this._RegionClip = false;
this.InitializeComponent();
this.SetStyle(ControlStyles.SupportsTransparentBackColor, true);
this.SetStyle(ControlStyles.OptimizedDoubleBuffer, true);
this.SetStyle(ControlStyles.AllPaintingInWmPaint, true);
}
开发者ID:lishxi,项目名称:_SharpMap,代码行数:22,代码来源:Shape.cs
注:本文中的LinearGradientMode类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论