コード例 #1
0
ファイル: CGColor.cs プロジェクト: cwensley/xamarin-macios
        static public CGColor?CreateByMatchingToColorSpace(CGColorSpace space, CGColorRenderingIntent intent,
                                                           CGColor color, NSDictionary options)
        {
            var h = CGColorCreateCopyByMatchingToColorSpace(space.GetHandle(), intent, color.GetHandle(), options.GetHandle());

            return(h == IntPtr.Zero ? null : new CGColor(h, owns: true));
        }
コード例 #2
0
        static CGColor CreateByMatchingToColorSpace(CGColorSpace space, CGColorRenderingIntent intent,
                                                    CGColor color, NSDictionary options)
        {
            var h = CGColorCreateCopyByMatchingToColorSpace(space == null ? IntPtr.Zero : space.Handle, intent,
                                                            color == null ? IntPtr.Zero : color.Handle, options == null ? IntPtr.Zero : options.Handle);

            return(h == IntPtr.Zero ? null : new CGColor(h));
        }
コード例 #3
0
ファイル: CGColor.cs プロジェクト: cwensley/xamarin-macios
 static IntPtr Create(CGColor source, nfloat alpha)
 {
     if (source is null)
     {
         throw new ArgumentNullException(nameof(source));
     }
     return(CGColorCreateCopyWithAlpha(source.GetCheckedHandle(), alpha));
 }
コード例 #4
0
        public override bool Equals(object o)
        {
            CGColor other = o as CGColor;

            if (other == null)
            {
                return(false);
            }

            return(CGColorEqualToColor(this.handle, other.handle));
        }
コード例 #5
0
 public void SetShadow(CGSize offset, nfloat blur, CGColor color = null)
 {
     if (color == null)
     {
         CGContextSetShadow(handle, offset, blur);
     }
     else
     {
         CGContextSetShadowWithColor(handle, offset, blur, color.handle);
     }
 }
コード例 #6
0
        public CGColor(CGColor source, nfloat alpha)
        {
            if (source == null)
            {
                throw new ArgumentNullException("source");
            }
            if (source.handle == IntPtr.Zero)
            {
                throw new ObjectDisposedException("source");
            }

            handle = CGColorCreateCopyWithAlpha(source.handle, alpha);
        }
コード例 #7
0
 public void SetStrokeColor(CGColor color)
 {
     CGContextSetStrokeColorWithColor(handle, color == null ? IntPtr.Zero : color.handle);
 }
コード例 #8
0
ファイル: CGColor.cs プロジェクト: cwensley/xamarin-macios
 public CGColor(CGColor source, nfloat alpha)
     : base(Create(source, alpha), true)
 {
 }