本文整理汇总了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 () }
};
}
示例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();
}
示例3: SetColor
public void SetColor (SolidBrush widget, Color color)
{
widget.ControlObject = color.ToCGColor ();
}
示例4: SetColor
public void SetColor (Pen widget, Color color)
{
((PenControl)widget.ControlObject).Color = color.ToCGColor ();
}
示例5: Create
public object Create (Color color, float thickness)
{
return new PenControl {
Color = color.ToCGColor (),
Thickness = thickness,
MiterLimit = 10f,
LineCap = PenLineCap.Square.ToCG ()
};
}
示例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 ()
};
}