• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# XColor类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: XLinearGradientBrush

 /// <summary>
 /// Initializes a new instance of the <see cref="XLinearGradientBrush"/> class.
 /// </summary>
 public XLinearGradientBrush(XPoint point1, XPoint point2, XColor color1, XColor color2)
 {
   this.point1 = point1;
   this.point2 = point2;
   this.color1 = color1;
   this.color2 = color2;
 }
开发者ID:inexorabletash,项目名称:PDFsharp,代码行数:10,代码来源:XLinearGradientBrush.cs


示例2: XPen

 internal XPen(XColor color, double width, bool immutable)
 {
   this.color = color;
   this.width = width;
   this.lineJoin = XLineJoin.Miter;
   this.lineCap = XLineCap.Flat;
   this.dashStyle = XDashStyle.Solid;
   this.dashOffset = 0f;
   this.immutable = immutable;
 }
开发者ID:AnthonyNystrom,项目名称:Pikling,代码行数:10,代码来源:XPen.cs


示例3: XPen

 internal XPen(XColor color, double width, bool immutable)
 {
     _color = color;
     _width = width;
     _lineJoin = XLineJoin.Miter;
     _lineCap = XLineCap.Flat;
     _dashStyle = XDashStyle.Solid;
     _dashOffset = 0f;
     _immutable = immutable;
 }
开发者ID:Sl0vi,项目名称:PDFsharp,代码行数:10,代码来源:XPen.cs


示例4: SetBackgroundColor

 public int SetBackgroundColor(XColor color)
 {
     return XSetWindowBackground (display.Handle, Handle, color.Pixel);
 }
开发者ID:ArsenShnurkov,项目名称:xsharp,代码行数:4,代码来源:xsharp.cs


示例5: SetForeground

 public int SetForeground(XColor foreground)
 {
     return XSetForeground (display.Handle, Handle, foreground.Pixel);
 }
开发者ID:ArsenShnurkov,项目名称:xsharp,代码行数:4,代码来源:xsharp.cs


示例6: SetBackground

 public int SetBackground(XColor background)
 {
     return XSetBackground (display.Handle, Handle, background.Pixel);
 }
开发者ID:ArsenShnurkov,项目名称:xsharp,代码行数:4,代码来源:xsharp.cs


示例7: DrawRectangle

 private static void DrawRectangle(XGraphics gfx,
     XColor backColor, XColor borderColor,
     XPen borderPen,
     int width, int height,
     int x, int y)
 {
     gfx.DrawRectangle(borderPen, x, y, width, height);
 }
开发者ID:rymbln,项目名称:WPFDB,代码行数:8,代码来源:DocumentManager.cs


示例8: XSolidBrush

 internal XSolidBrush(XColor color, bool immutable)
 {
     _color = color;
     _immutable = immutable;
 }
开发者ID:Sl0vi,项目名称:PDFsharp,代码行数:5,代码来源:XSolidBrush.cs


示例9: ColorItem

 public ColorItem(XColor color, string name)
 {
     Color = color;
     Name = name;
 }
开发者ID:Core2D,项目名称:PDFsharp,代码行数:5,代码来源:ColorComboBox.cs


示例10: WorldColors

        public void WorldColors(World world, out XColor penColorOut, out XColor brushColorOut)
        {
            Color penColor = Color.Empty;
            Color brushColor = Color.Empty;

            if (showWorldDetailColors)
            {
                if (world.IsAg && world.IsRi)
                {
                    penColor = brushColor = Color.Gold;
                }
                else if (world.IsAg)
                {
                    penColor = brushColor = Color.Green;
                }
                else if (world.IsRi)
                {
                    penColor = brushColor = Color.Purple;
                }
                else if (world.IsIn)
                {
                    penColor = brushColor = Color.FromArgb(0x88, 0x88, 0x88); // Gray
                }
                else if (world.Atmosphere > 10)
                {
                    penColor = brushColor = Color.FromArgb(0xcc, 0x66, 0x26); // Rust
                }
                else if (world.IsVa)
                {
                    brushColor = Color.Black;
                    penColor = Color.White;
                }
                else if (world.WaterPresent)
                {
                    brushColor = worldWater.fillColor;
                    penColor = worldWater.pen.color;
                }
                else
                {
                    brushColor = worldNoWater.fillColor;
                    penColor = worldNoWater.pen.color;
                }
            }
            else
            {
                // Classic colors

                // World disc
                brushColor = (world.WaterPresent) ? worldWater.fillColor : worldNoWater.fillColor;
                penColor = (world.WaterPresent) ? worldWater.pen.color : worldNoWater.pen.color;
            }

            penColorOut = penColor.IsEmpty ? XColor.Empty : penColor;
            brushColorOut = brushColor.IsEmpty ? XColor.Empty : brushColor;
        }
开发者ID:Matt--,项目名称:travellermap,代码行数:55,代码来源:Stylesheet.cs


示例11: FromArgb

 /// <summary>
 /// Creates an XColor structure from the specified alpha value and color.
 /// </summary>
 public static XColor FromArgb(int alpha, XColor color)
 {
   color.A = ((byte)alpha) / 255.0;
   return color;
 }
开发者ID:inexorabletash,项目名称:PDFsharp,代码行数:8,代码来源:XColor.cs


示例12: XSolidBrush

 internal XSolidBrush(XColor color, bool immutable)
 {
   this.color = color;
   this.immutable = immutable;
 }
开发者ID:zheimer,项目名称:PDFSharp,代码行数:5,代码来源:XSolidBrush.cs


示例13: Clear

    //public void Flush();
    //public void Flush(FlushIntention intention);

    #region Drawing

    // ----- Clear --------------------------------------------------------------------------------

    /// <summary>
    /// Fills the entire drawing surface with the specified color. The functions works only if
    /// the current transformation is identity, i.e. the function should be called only immediately
    /// after the XGraphics object was created.
    /// </summary>
    public void Clear(XColor color)
    {
      if (this.drawGraphics)
      {
#if GDI
        if (this.targetContext == XGraphicTargetContext.GDI)
          this.gfx.Clear(color.ToGdiColor());
#endif
#if WPF
        if (this.targetContext == XGraphicTargetContext.WPF)
        {
          Rect rc = new Rect();
          rc.Width = rc.Height = 10000;
          this.dc.DrawRectangle(new SolidColorBrush(color.ToWpfColor()), null, rc);
        }
#endif
      }

      if (this.renderer != null)
        this.renderer.Clear(color);
    }
开发者ID:Davincier,项目名称:openpetra,代码行数:33,代码来源:XGraphics.cs


示例14: DrawBadgeElement

        private static void DrawBadgeElement(Badge badge, XGraphics gfx)
        {
            var color = ConverterManager.HexToColorConverter(badge.ForegroundColor);
            XColor borderColor = new XColor { R = color.R, G = color.G, B = color.B };
            color = ConverterManager.HexToColorConverter(badge.BackgroundColor);
            XColor backColor = new XColor { R = color.R, G = color.G, B = color.B };
            color = ConverterManager.HexToColorConverter(badge.FontColor);
            XColor fontColor = new XColor { R = color.R, G = color.G, B = color.B };
            XPen pen = new XPen(borderColor, double.Parse(badge.BorderWidth.ToString()));

            DrawRectangle(gfx, backColor, borderColor, pen, badge.Width, badge.Height, badge.PositionX1, badge.PositionY1);
            DrawText(gfx, badge.Value, badge.Font, badge.FontStyle, badge.FontSize, badge.FontColor, badge.Width, badge.Height, badge.PositionX1, badge.PositionY1);
        }
开发者ID:rymbln,项目名称:WPFDB,代码行数:13,代码来源:DocumentManager.cs


示例15: XColor

		public XColor( XColor xc )
		{
			color = xc.color;
		}
开发者ID:d3x0r,项目名称:Voxelarium,代码行数:4,代码来源:XColor.cs


示例16: XCreatePixmapCursor

		internal extern static IntPtr XCreatePixmapCursor(IntPtr display, IntPtr source, IntPtr mask, ref XColor foreground_color, ref XColor background_color, int x_hot, int y_hot);
开发者ID:nlhepler,项目名称:mono,代码行数:1,代码来源:XplatUIX11.cs


示例17: SetWindowBorder

 public int SetWindowBorder(XColor color)
 {
     return XSetWindowBorder (display.Handle, Handle, color.Pixel);
 }
开发者ID:ArsenShnurkov,项目名称:xsharp,代码行数:4,代码来源:xsharp.cs


示例18: XLookupColor

		internal extern static int XLookupColor(IntPtr display, IntPtr Colormap, string Coloranem, ref XColor exact_def_color, ref XColor screen_def_color);
开发者ID:nlhepler,项目名称:mono,代码行数:1,代码来源:XplatUIX11.cs


示例19: XAllocColor

		internal extern static int XAllocColor(IntPtr display, IntPtr Colormap, ref XColor colorcell_def);
开发者ID:nlhepler,项目名称:mono,代码行数:1,代码来源:XplatUIX11.cs


示例20: GetReversibleControlGC

		IntPtr GetReversibleControlGC (Control control, int line_width)
		{
			XGCValues	gc_values;
			IntPtr		gc;

			gc_values = new XGCValues();

			gc_values.subwindow_mode = GCSubwindowMode.IncludeInferiors;
			gc_values.line_width = line_width;
			gc_values.foreground = XBlackPixel(DisplayHandle, ScreenNo);

			// This logic will give us true rubber bands: (libsx, SANE_XOR)
			//mask = foreground ^ background; 
			//XSetForeground(DisplayHandle, gc, 0xffffffff);
			//XSetBackground(DisplayHandle, gc, background);
			//XSetFunction(DisplayHandle,   gc, GXxor);
			//XSetPlaneMask(DisplayHandle,  gc, mask);


			gc = XCreateGC(DisplayHandle, control.Handle, new IntPtr ((int) (GCFunction.GCSubwindowMode | GCFunction.GCLineWidth | GCFunction.GCForeground)), ref gc_values);
			uint foreground;
			uint background;

			XColor xcolor = new XColor();

			xcolor.red = (ushort)(control.ForeColor.R * 257);
			xcolor.green = (ushort)(control.ForeColor.G * 257);
			xcolor.blue = (ushort)(control.ForeColor.B * 257);
			XAllocColor(DisplayHandle, DefaultColormap, ref xcolor);
			foreground = (uint)xcolor.pixel.ToInt32();

			xcolor.red = (ushort)(control.BackColor.R * 257);
			xcolor.green = (ushort)(control.BackColor.G * 257);
			xcolor.blue = (ushort)(control.BackColor.B * 257);
			XAllocColor(DisplayHandle, DefaultColormap, ref xcolor);
			background = (uint)xcolor.pixel.ToInt32();

			uint mask = foreground ^ background; 

			XSetForeground(DisplayHandle, gc, (UIntPtr)0xffffffff);
			XSetBackground(DisplayHandle, gc, (UIntPtr)background);
			XSetFunction(DisplayHandle,   gc, GXFunction.GXxor);
			XSetPlaneMask(DisplayHandle,  gc, (IntPtr)mask);

			return gc;
		}
开发者ID:nlhepler,项目名称:mono,代码行数:46,代码来源:XplatUIX11.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# XCore类代码示例发布时间:2022-05-24
下一篇:
C# XBase类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap