当前位置: 首页>>代码示例>>C#>>正文


C# LinearGradientMode类代码示例

本文整理汇总了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;
		}
开发者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


注:本文中的LinearGradientMode类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。