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


C# Brush类代码示例

本文整理汇总了C#中Brush的典型用法代码示例。如果您正苦于以下问题:C# Brush类的具体用法?C# Brush怎么用?C# Brush使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


Brush类属于命名空间,在下文中一共展示了Brush类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Brush

 public Brush(Brush brush)
 {
     Color = brush.Color;
     Background = brush.Background;
     BitmapId = brush.BitmapId;
     FillStyle = brush.FillStyle;
 }
开发者ID:jdeksup,项目名称:Mapsui.Net4,代码行数:7,代码来源:Brush.cs

示例2: PieChart

 public PieChart(float fltCount, float fltTotal, Color c)
 {
     this.fltCount = fltCount;
     this.fltTotal = fltTotal;
     this.colorSlice = c;
     this.brushSlice = new SolidBrush(c);
 }
开发者ID:nehawadhwa,项目名称:ccweb,代码行数:7,代码来源:CP_ChartBuilder.ascx.cs

示例3: Button

        public Button(string pText, float pX, float pY, float pWidth, float pHeight, bool pSmall)
        {
            width = pWidth;
            height = pHeight;
            x = pX;
            y = pY;

            // Text properties
            var brushProp = new LinearGradientBrushProperties();
            brushProp.StartPoint = new Vector2(x, y);
            brushProp.EndPoint = new Vector2(x, y + height);

            var stops = new GradientStop[2];
            stops[0] = new GradientStop() { Color = new Color4(1, 1, 1, 0.5f), Position = 0 };
            stops[1] = new GradientStop() { Color = new Color4(1, 1, 1, 1.0f), Position = 1 };

            textBrush = new LinearGradientBrush(GraphicsWindow.Instance.RenderTarget2D, brushProp, new GradientStopCollection(GraphicsWindow.Instance.RenderTarget2D, stops));
            textLayout = new TextLayout(Factories.FactoryWrite, pText, pSmall? Constants.SmallFont : Constants.RegularFont, width, height);

            // Frame properties
            borderBrush = new SolidColorBrush(GraphicsWindow.Instance.RenderTarget2D, new Color4(0, 0, 0, 0.3f));
            backBrush = new SolidColorBrush(GraphicsWindow.Instance.RenderTarget2D, new Color4(0.1f, 0.3f, 0.4f, 0.5f));
            highlightBrush = new SolidColorBrush(GraphicsWindow.Instance.RenderTarget2D, new Color4(0.2f, 0.6f, 0.8f, 0.5f));
            highlight = false;
        }
开发者ID:jonathandlo,项目名称:deep-space-dive,代码行数:25,代码来源:Button.cs

示例4: CreateRectangle

    public static Rectangle CreateRectangle(Brush brush)
    {
        Rectangle rt = new Rectangle();
        rt.Fill = brush;

        return rt;
    }
开发者ID:vesteksoftware,项目名称:VT8642,代码行数:7,代码来源:UIUtility.cs

示例5: Initialize

 public virtual void Initialize(DeviceManager deviceManager)
 {
     sceneColorBrush = new SolidColorBrush(deviceManager.ContextDirect2D, Color.Blue);
     textFormat = new TextFormat(deviceManager.FactoryDirectWrite, "Calibri", 20) { TextAlignment = TextAlignment.Leading, ParagraphAlignment = ParagraphAlignment.Center };
     clock = Stopwatch.StartNew();
     deviceManager.ContextDirect2D.TextAntialiasMode = TextAntialiasMode.Grayscale;
 }
开发者ID:j796160836,项目名称:Multi-Touch-Example,代码行数:7,代码来源:FpsRenderer.cs

示例6: Awake

	override protected void Awake() {
		base.Awake();
		
		wizard = GameObject.Find("Wizard").GetComponent<Wizard>();
		candy = GameObject.Find("Candy").GetComponent<Candy>();
		eraserBrush = GameObject.Find("EraserBrush").GetComponent<Brush>(); 
	}
开发者ID:maximzavadskiy,项目名称:code-samples,代码行数:7,代码来源:CandyWizardGameManager.cs

示例7: Initialize

        public virtual void Initialize(DeviceManager deviceManager)
        {

            sceneColorBrush = new SolidColorBrush(deviceManager.ContextDirect2D, Colors.White);

            clock = Stopwatch.StartNew();
        }
开发者ID:vulcanlee,项目名称:Windows8Lab,代码行数:7,代码来源:ShapeRenderer.cs

示例8: BrushToNativeBrush

        private System.Drawing.Brush BrushToNativeBrush(Brush brush)
        {
            if (brush is SolidBrush)
            {
                return new System.Drawing.SolidBrush(ColorToNativeColor((brush as SolidBrush).Color));
            }
            else if (brush is LinearGradientBrush)
            {
                LinearGradientBrush b = (brush as LinearGradientBrush);
                System.Drawing.Drawing2D.LinearGradientBrush lgb = new System.Drawing.Drawing2D.LinearGradientBrush(RectangleToNativeRectangleF(b.Bounds), ColorToNativeColor(b.ColorStops[0].Color), ColorToNativeColor(b.ColorStops[b.ColorStops.Count - 1].Color), LinearGradientBrushOrientationToLinearGradientMode(b.Orientation));
                if (b.ColorStops.Count > 2)
                {
                    List<System.Drawing.Color> colorList = new List<System.Drawing.Color>();
                    List<float> positionList = new List<float>();

                    for (int i = 0; i < b.ColorStops.Count; i++)
                    {
                        colorList.Add(ColorToNativeColor(b.ColorStops[i].Color));
                        positionList.Add((float)(b.ColorStops[i].Position.ConvertTo(MeasurementUnit.Decimal).Value));
                    }

                    System.Drawing.Drawing2D.ColorBlend blend = new System.Drawing.Drawing2D.ColorBlend(b.ColorStops.Count);
                    blend.Colors = colorList.ToArray();
                    blend.Positions = positionList.ToArray();
                    lgb.InterpolationColors = blend;
                }
                return lgb;
            }
            return null;
        }
开发者ID:alcexhim,项目名称:UniversalWidgetToolkit,代码行数:30,代码来源:Win32Graphics.cs

示例9: DrawRectangle

 private void DrawRectangle(Brush brush, float width, float height, float lineWidth) {
     surfaceGraphics.FillRectangle(brush,
         -width / 2f - lineWidth,
         -height / 2f - lineWidth,
         width + 2f * lineWidth,
         height + 2f * lineWidth);
 }
开发者ID:javidondeesta,项目名称:tech-talks,代码行数:7,代码来源:MultiThumbnailGenerator.cs

示例10: Set

 public Brush Set(Brush brush)
 {
     Sprite = brush.Sprite;
     Angle = brush.Angle;
     Scale = brush.Scale;
     return this;
 }
开发者ID:Sipaha,项目名称:MateriaTD,代码行数:7,代码来源:Brush.cs

示例11: GenerateImage

 private void GenerateImage(
     HttpResponse response,
     string textToInsert,
     int width,
     int height,
     Color backgroundColor,
     FontFamily fontFamily,
     float emSize,
     Brush brush,
     float x,
     float y,
     string contentType,
     ImageFormat imageFormat)
 {
     using (Bitmap bitmap = new Bitmap(width, height))
     {
         using (Graphics graphics = Graphics.FromImage(bitmap))
         {
             graphics.Clear(backgroundColor);
             graphics.DrawString(textToInsert, new Font(fontFamily, emSize), brush, x, y);
             response.ContentType = contentType;
             bitmap.Save(response.OutputStream, imageFormat);
         }
     }
 }
开发者ID:nikolaynikolov,项目名称:Telerik,代码行数:25,代码来源:TextToImageHttpHandler.cs

示例12: PerspexTextRenderer

 public PerspexTextRenderer(
     RenderTarget target,
     Brush foreground)
 {
     this.renderTarget = target;
     this.foreground = foreground;
 }
开发者ID:Robertofon,项目名称:Perspex,代码行数:7,代码来源:PerspexTextRenderer.cs

示例13: Element

		protected Element (Pen pen, Brush brush)
		{
			Id = "";
			Pen = pen;
			Brush = brush;
			Transform = NGraphics.Transform.Identity;
		}
开发者ID:superlloyd,项目名称:NGraphics,代码行数:7,代码来源:Element.cs

示例14: RectangleRenderUnit

 /// <summary>
 /// Initializes a new instance of the <see cref="RectangleRenderUnit" /> class.
 /// </summary>
 /// <param name="rectangle">The rectangle.</param>
 /// <param name="stroke">The stroke.</param>
 /// <param name="fill">The fill.</param>
 /// <param name="thickness">The thickness.</param>
 public RectangleRenderUnit(RectangleF rectangle, Brush stroke, Brush fill, float thickness)
 {
     this.rectangle = rectangle;
     this.stroke = stroke;
     this.fill = fill;
     this.thickness = thickness;
 }
开发者ID:huoxudong125,项目名称:oxyplot,代码行数:14,代码来源:RectangleRenderUnit.cs

示例15: Element

 public Element(Pen pen, Brush brush)
 {
     Id = Guid.NewGuid ().ToString ();
     Pen = pen;
     Brush = brush;
     Transform = NGraphics.Transform.Identity;
 }
开发者ID:xamarin-libraries,项目名称:xamarin-libraries,代码行数:7,代码来源:Element.cs


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