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


C# Color.ToCGColor方法代码示例

本文整理汇总了C#中Color.ToCGColor方法的典型用法代码示例。如果您正苦于以下问题:C# Color.ToCGColor方法的具体用法?C# Color.ToCGColor怎么用?C# Color.ToCGColor使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Color的用法示例。


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

示例1: MakePopover

 public static NSPopover MakePopover(Xwt.Widget child, Color backgroundColor)
 {
     return new NSPopover {
         Behavior = NSPopoverBehavior.Transient,
         ContentViewController = new FactoryViewController (child) { BackgroundColor = backgroundColor.ToCGColor () }
     };
 }
开发者ID:henriquemotaesteves,项目名称:xwt,代码行数:7,代码来源:PopoverBackend.cs

示例2: SetPixel

        public void SetPixel(int x, int y, Color color)
        {
            if (x < 0 || x > NativeCGImage.Width - 1)
                throw new InvalidEnumArgumentException ("Parameter must be positive and < Width.");
            if (y < 0 || y > NativeCGImage.Height - 1)
                throw new InvalidEnumArgumentException ("Parameter must be positive and < Height.");

            MakeSureWeHaveAnAlphaChannel ();

            // We are going to cheat here by drawing directly to the cached context that is
            // associated to the image.  This way we do not have to play with pixels and offsets
            // to change the data.  If this proves to be non performant then we will change it later.
            cachedContext.SaveState ();
            cachedContext.ConcatCTM (cachedContext.GetCTM ().Invert ());
            cachedContext.ConcatCTM (imageTransform);
            cachedContext.SetFillColor(color.ToCGColor());
            cachedContext.FillRect (new RectangleF(x,y, 1,1));
            cachedContext.FillPath ();
            cachedContext.RestoreState();
        }
开发者ID:ronaldli,项目名称:sysdrawing-coregraphics,代码行数:20,代码来源:Bitmap.cs

示例3: SetColor

		public void SetColor (SolidBrush widget, Color color)
		{
			widget.ControlObject = color.ToCGColor ();
		}
开发者ID:JohnACarruthers,项目名称:Eto,代码行数:4,代码来源:SolidBrushHandler.cs

示例4: SetColor

		public void SetColor (Pen widget, Color color)
		{
			((PenControl)widget.ControlObject).Color = color.ToCGColor ();
		}
开发者ID:Exe0,项目名称:Eto,代码行数:4,代码来源:PenHandler.cs

示例5: Create

		public object Create (Color color, float thickness)
		{
			return new PenControl {
				Color = color.ToCGColor (),
				Thickness = thickness,
				MiterLimit = 10f,
				LineCap = PenLineCap.Square.ToCG ()
			};
		}
开发者ID:Exe0,项目名称:Eto,代码行数:9,代码来源:PenHandler.cs

示例6: Create

		public object Create (Color startColor, Color endColor, PointF startPoint, PointF endPoint)
		{
			return new BrushObject {
				Gradient = new CGGradient(CGColorSpace.CreateDeviceRGB(), new CGColor [] { startColor.ToCGColor (), endColor.ToCGColor () } ),
				InverseGradient = new CGGradient(CGColorSpace.CreateDeviceRGB(), new CGColor [] { endColor.ToCGColor (), startColor.ToCGColor () } ),
				StartPoint = startPoint.ToSD (),
				EndPoint = endPoint.ToSD ()
			};
		}
开发者ID:JohnACarruthers,项目名称:Eto,代码行数:9,代码来源:LinearGradientBrushHandler.cs


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