Example #1
0
        public CGColor(CGColorSpace colorspace, CGPattern pattern, nfloat [] components)
        {
            if (colorspace == null)
            {
                throw new ArgumentNullException("colorspace");
            }
            if (colorspace.handle == IntPtr.Zero)
            {
                throw new ObjectDisposedException("colorspace");
            }
            if (pattern == null)
            {
                throw new ArgumentNullException("pattern");
            }
            if (components == null)
            {
                throw new ArgumentNullException("components");
            }

            handle = CGColorCreateWithPattern(colorspace.handle, pattern.Handle, components);
            if (handle == IntPtr.Zero)
            {
                throw new ArgumentException();
            }
        }
Example #2
0
        public CGColor(CGColorSpace colorspace, CGPattern pattern, nfloat [] components)
        {
            if (components == null)
            {
                global::ObjCRuntime.ThrowHelper.ThrowArgumentNullException(nameof(components));
            }
            var colorspace_handle = colorspace.GetNonNullHandle(nameof(colorspace));
            var pattern_handle    = pattern.GetNonNullHandle(nameof(pattern));

            handle = CGColorCreateWithPattern(colorspace_handle, pattern_handle, components);
            if (handle == IntPtr.Zero)
            {
                throw new ArgumentException();
            }
        }
Example #3
0
 public void SetStrokePattern(CGPattern pattern, nfloat [] components)
 {
     CGContextSetStrokePattern(handle, pattern.GetHandle(), components);
 }
Example #4
0
 public CGColor(CGColorSpace colorspace, CGPattern pattern, nfloat [] components)
     : base(Create(colorspace, pattern, components), true)
 {
 }