本文整理汇总了C#中LinearGradientMode类的典型用法代码示例。如果您正苦于以下问题:C# LinearGradientMode类的具体用法?C# LinearGradientMode怎么用?C# LinearGradientMode使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
LinearGradientMode类属于命名空间,在下文中一共展示了LinearGradientMode类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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;
}
示例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);
}
示例3: GradientStyle
public GradientStyle(Color light, Color dark, LinearGradientMode mode)
{
Type = GradientType.LinearGradientMode;
FirstColor = dark;
SecondColor = light;
GradMode = mode;
}
示例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");
}
}
示例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);
}
示例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);
}
示例7: BrushParameter
public BrushParameter()
{
_color1 = Color.Black;
_color2 = Color.Empty;
_mode = LinearGradientMode.Vertical;
}
示例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);
}
示例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;
}
示例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);
}
示例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;
}
示例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);
}
}
}
示例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;
}
示例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();
}