當前位置: 首頁>>代碼示例>>C#>>正文


C# Drawing2D.Blend類代碼示例

本文整理匯總了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 };
 }
開發者ID:Ejik,項目名稱:Acotwin,代碼行數:7,代碼來源:Office2007Renderer.cs

示例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 };
 }
開發者ID:ComponentFactory,項目名稱:Krypton,代碼行數:7,代碼來源:KryptonOffice2007Renderer.cs

示例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);
                }
            }
        }
開發者ID:KelvinCoding,項目名稱:masterwork-dwarf-fortress,代碼行數:29,代碼來源:ButtonsCaptionEditor.cs

示例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);
     }
 }
開發者ID:kinghand,項目名稱:KHGraphDB,代碼行數:36,代碼來源:MenuRender.cs

示例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;
                }
            }
        }
開發者ID:michaelbehner96,項目名稱:Xyzzxyz,代碼行數:27,代碼來源:Pure.cs

示例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 };
 }
開發者ID:Cocotteseb,項目名稱:Krypton,代碼行數:7,代碼來源:KryptonSparkleRenderer.cs

示例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();
        }
開發者ID:dockpanelsuite,項目名稱:dockpanelsuite,代碼行數:26,代碼來源:VS2005MultithreadingDockPaneCaption.cs

示例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 };
        }
開發者ID:Cocotteseb,項目名稱:Krypton,代碼行數:10,代碼來源:ViewDrawRibbonTab.cs

示例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 };
        }
開發者ID:ComponentFactory,項目名稱:Krypton,代碼行數:10,代碼來源:RenderExpertHelpers.cs

示例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;
 }
開發者ID:revenz,項目名稱:iMeta,代碼行數:11,代碼來源:MetaNodeItem.cs

示例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;
		}
開發者ID:kevins1022,項目名稱:Altman,代碼行數:11,代碼來源:TabStyleVS2010Provider.cs

示例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};
		}
開發者ID:KonajuGames,項目名稱:SharpLang,代碼行數:12,代碼來源:ThemeNice.cs

示例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;
        }
開發者ID:nacholemmo,項目名稱:ImageProcessor,代碼行數:65,代碼來源:PolaroidMatrixFilter.cs

示例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);
     }
 }
開發者ID:KelvinCoding,項目名稱:masterwork-dwarf-fortress,代碼行數:12,代碼來源:CaptionGradientEditor.cs

示例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 };
 }
開發者ID:shankithegreat,項目名稱:commanderdotnet,代碼行數:12,代碼來源:TabStripIE7Renderer.cs


注:本文中的System.Drawing.Drawing2D.Blend類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。