當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。