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)); }
public CGImage(nint width, nint height, nint bitsPerComponent, nint bitsPerPixel, nint bytesPerRow, CGColorSpace colorSpace, CGBitmapFlags bitmapFlags, CGDataProvider provider, nfloat [] decode, bool shouldInterpolate, CGColorRenderingIntent intent) { if (colorSpace == null) { throw new ArgumentNullException("colorSpace"); } if (width < 0) { throw new ArgumentException("width"); } if (height < 0) { throw new ArgumentException("height"); } if (bitsPerPixel < 0) { throw new ArgumentException("bitsPerPixel"); } if (bitsPerComponent < 0) { throw new ArgumentException("bitsPerComponent"); } if (bytesPerRow < 0) { throw new ArgumentException("bytesPerRow"); } handle = CGImageCreate(new IntPtr(width), new IntPtr(height), new IntPtr(bitsPerComponent), new IntPtr(bitsPerPixel), new IntPtr(bytesPerRow), colorSpace.Handle, bitmapFlags, provider == null ? IntPtr.Zero : provider.Handle, decode, shouldInterpolate, intent); }
public CGImage(int width, int height, int bitsPerComponent, int bitsPerPixel, int bytesPerRow, CGColorSpace colorSpace, CGImageAlphaInfo alphaInfo, CGDataProvider provider, nfloat [] decode, bool shouldInterpolate, CGColorRenderingIntent intent) { if (width < 0) { throw new ArgumentException("width"); } if (height < 0) { throw new ArgumentException("height"); } if (bitsPerPixel < 0) { throw new ArgumentException("bitsPerPixel"); } if (bitsPerComponent < 0) { throw new ArgumentException("bitsPerComponent"); } if (bytesPerRow < 0) { throw new ArgumentException("bytesPerRow"); } handle = CGImageCreate(width, height, bitsPerComponent, bitsPerPixel, bytesPerRow, colorSpace == null ? IntPtr.Zero : colorSpace.Handle, (CGBitmapFlags)alphaInfo, provider == null ? IntPtr.Zero : provider.Handle, decode, shouldInterpolate, intent); }
extern static IntPtr CGImageCreate(IntPtr size_t_width, IntPtr size_t_height, IntPtr size_t_bitsPerComponent, IntPtr size_t_bitsPerPixel, IntPtr size_t_bytesPerRow, IntPtr /* CGColorSpaceRef */ space, CGBitmapFlags bitmapInfo, IntPtr /* CGDataProviderRef */ provider, nfloat [] decode, bool shouldInterpolate, CGColorRenderingIntent intent);
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)); }
partial void ScreenButton_down(UIButton sender) { if (!isScreen) { ScreenshotView.Hidden = false; ScreenBtn.SetTitle("Hide screen", UIControlState.Normal); isScreen = true; int val = 1920 * 1080 * 4 + 8; //ARGB 1920x1080 + 8(iosspecific) IntPtr b = Marshal.AllocHGlobal(val); int val1 = -1; //return realsize after getvideoshot int val2 = -1; //return realsize after getvideoshot int val3 = 0; //return realsize after getvideoshot int rc = _mediaPlayer.GetVideoShot(b, ref val, ref val1, ref val2, ref val3); if (rc == -2) { System.Console.WriteLine(String.Format("<binary> rc: {0} , not enough space allocated", rc)); Marshal.FreeHGlobal(b); return; } else if (rc == -1) { System.Console.WriteLine(String.Format("<binary> rc: {0} , error", rc)); Marshal.FreeHGlobal(b); return; } CGDataProvider provider = new CGDataProvider(b, val); int bitsPerComponent = 8; int bitsPerPixel = 32; int bytesPerRow = val3; CGColorSpace colorspaceref = CGColorSpace.CreateDeviceRGB(); CGBitmapFlags bitmapinfo = CGBitmapFlags.ByteOrder32Little | CGBitmapFlags.NoneSkipFirst; CGColorRenderingIntent renderintent = CGColorRenderingIntent.Default; CGImage imageref = new CGImage(val1, val2, bitsPerComponent, bitsPerPixel, val3, colorspaceref, bitmapinfo, provider, null, true, renderintent); UIImage img = new UIImage(imageref); ScrenShotImageView.Image = img; Marshal.FreeHGlobal(b); } else { ScreenBtn.SetTitle("Screen", UIControlState.Normal); ScreenshotView.Hidden = true; isScreen = false; } }
extern static /* CGImageRef */ IntPtr CGImageCreateWithPNGDataProvider (/* CGDataProviderRef */ IntPtr source, /* CGFloat[] */ nfloat [] decode, bool shouldInterpolate, CGColorRenderingIntent intent);
public void SetRenderingIntent(CGColorRenderingIntent intent) { CGContextSetRenderingIntent(handle, intent); }
extern static void CGContextSetRenderingIntent(IntPtr context, CGColorRenderingIntent intent);
extern static /* CGImageRef */ IntPtr CGImageCreateWithJPEGDataProvider(/* CGDataProviderRef */ IntPtr source, /* CGFloat[] */ nfloat [] decode, bool shouldInterpolate, CGColorRenderingIntent intent);
extern static IntPtr CGImageCreate(int size_t_width, int size_t_height, int size_t_bitsPerComponent, int size_t_bitsPerPixel, int size_t_bytesPerRow, IntPtr /* CGColorSpaceRef */ space, CGBitmapFlags bitmapInfo, IntPtr /* CGDataProviderRef */ provider, float [] decode, bool shouldInterpolate, CGColorRenderingIntent intent);
extern static /* CGImageRef */ IntPtr CGImageCreateWithPNGDataProvider(/* CGDataProviderRef */ IntPtr source, /* CGFloat[] */ nfloat [] decode, [MarshalAs(UnmanagedType.I1)] bool shouldInterpolate, CGColorRenderingIntent intent);
extern static /* CGImageRef */ IntPtr CGImageCreate(/* size_t */ nint width, /* size_t */ nint height, /* size_t */ nint bitsPerComponent, /* size_t */ nint bitsPerPixel, /* size_t */ nint bytesPerRow, /* CGColorSpaceRef */ IntPtr space, CGBitmapFlags bitmapInfo, /* CGDataProviderRef */ IntPtr provider, /* CGFloat[] */ nfloat [] decode, [MarshalAs(UnmanagedType.I1)] bool shouldInterpolate, CGColorRenderingIntent intent);
extern static IntPtr CGImageCreateWithPNGDataProvider(IntPtr /*CGDataProviderRef*/ source, nfloat [] decode, bool shouldInterpolate, CGColorRenderingIntent intent);
extern static IntPtr CGImageCreateWithPNGDataProvider(IntPtr /*CGDataProviderRef*/ source, float [] decode, bool shouldInterpolate, CGColorRenderingIntent intent);
public CGImage (int width, int height, int bitsPerComponent, int bitsPerPixel, int bytesPerRow, CGColorSpace colorSpace, CGImageAlphaInfo alphaInfo, CGDataProvider provider, nfloat [] decode, bool shouldInterpolate, CGColorRenderingIntent intent) { if (width < 0) throw new ArgumentException ("width"); if (height < 0) throw new ArgumentException ("height"); if (bitsPerPixel < 0) throw new ArgumentException ("bitsPerPixel"); if (bitsPerComponent < 0) throw new ArgumentException ("bitsPerComponent"); if (bytesPerRow < 0) throw new ArgumentException ("bytesPerRow"); handle = CGImageCreate (width, height, bitsPerComponent, bitsPerPixel, bytesPerRow, colorSpace == null ? IntPtr.Zero : colorSpace.Handle, (CGBitmapFlags) alphaInfo, provider == null ? IntPtr.Zero : provider.Handle, decode, shouldInterpolate, intent); }
extern static /* CGImageRef */ IntPtr CGImageCreate (/* size_t */ nint width, /* size_t */ nint height, /* size_t */ nint bitsPerComponent, /* size_t */ nint bitsPerPixel, /* size_t */ nint bytesPerRow, /* CGColorSpaceRef */ IntPtr space, CGBitmapFlags bitmapInfo, /* CGDataProviderRef */ IntPtr provider, /* CGFloat[] */ nfloat [] decode, bool shouldInterpolate, CGColorRenderingIntent intent);
public static CGImage FromPNG (CGDataProvider provider, float [] decode, bool shouldInterpolate, CGColorRenderingIntent intent) { if (provider == null) throw new ArgumentNullException ("provider"); var handle = CGImageCreateWithPNGDataProvider (provider.Handle, decode, shouldInterpolate, intent); if (handle == IntPtr.Zero) return null; return new CGImage (handle, true); }
static extern IntPtr CGColorConverterCreate(/* __nullable CFDictionaryRef */ IntPtr options, /* CGColorSpaceRef __nullable */ IntPtr space1, CGColorConverterTransformType transform1, CGColorRenderingIntent intent1, /* CGColorSpaceRef __nullable */ IntPtr space2, CGColorConverterTransformType transform2, CGColorRenderingIntent intent2, /* CGColorSpaceRef __nullable */ IntPtr space3, CGColorConverterTransformType transform3, CGColorRenderingIntent intent3, IntPtr lastSpaceMarker);
public static CGImage FromJPEG(CGDataProvider provider, nfloat [] decode, bool shouldInterpolate, CGColorRenderingIntent intent) { if (provider == null) { throw new ArgumentNullException("provider"); } var handle = CGImageCreateWithJPEGDataProvider(provider.Handle, decode, shouldInterpolate, intent); if (handle == IntPtr.Zero) { return(null); } return(new CGImage(handle, true)); }
public static CGImage FromPNG (CGDataProvider provider, nfloat [] decode, bool shouldInterpolate, CGColorRenderingIntent intent) { var handle = CGImageCreateWithPNGDataProvider (provider == null ? IntPtr.Zero : provider.Handle, decode, shouldInterpolate, intent); if (handle == IntPtr.Zero) return null; return new CGImage (handle, true); }
static extern /* CGColorRef __nullable */ IntPtr CGColorCreateCopyByMatchingToColorSpace( /* __nullable CGColorSpaceRef* */ IntPtr space, CGColorRenderingIntent intent, /* CGColorRef __nullable */ IntPtr color, /* __nullable CFDictionaryRef */ IntPtr options);
static extern /* CGColorRef __nullable */ IntPtr CGColorCreateCopyByMatchingToColorSpace ( /* __nullable CGColorSpaceRef* */ IntPtr space, CGColorRenderingIntent intent, /* CGColorRef __nullable */ IntPtr color, /* __nullable CFDictionaryRef */ IntPtr options);
extern static /* CGColorConversionInfoRef __nullable */ IntPtr CGColorConversionInfoCreateFromList(/* __nullable CFDictionaryRef */ IntPtr options, /* CGColorSpaceRef __nullable */ IntPtr space1, CGColorConversionInfoTransformType transform1, CGColorRenderingIntent intent1, /* CGColorSpaceRef __nullable */ IntPtr space2, CGColorConversionInfoTransformType transform2, CGColorRenderingIntent intent2, /* CGColorSpaceRef __nullable */ IntPtr space3, CGColorConversionInfoTransformType transform3, CGColorRenderingIntent intent3, IntPtr lastSpaceMarker);
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); }
public void SetRenderingIntent (CGColorRenderingIntent intent) { CGContextSetRenderingIntent (handle, intent); }
public static CGImage FromPNG(CGDataProvider provider, nfloat [] decode, bool shouldInterpolate, CGColorRenderingIntent intent) { var handle = CGImageCreateWithPNGDataProvider(provider == null ? IntPtr.Zero : provider.Handle, decode, shouldInterpolate, intent); if (handle == IntPtr.Zero) { return(null); } return(new CGImage(handle, true)); }
CGImage NewCGImage(int width, int height, int bitsPerComponent, int bitsPerPixel, int bytesPerRow, CGColorSpace colorSpace, CGBitmapFlags bitmapFlags, CGDataProvider provider, nfloat[] decode, bool shouldInterpolate, CGColorRenderingIntent intent) { var image = new CGImage(width, height, bitsPerComponent, bitsPerPixel, bytesPerRow, colorSpace, bitmapFlags, dataProvider, decode, shouldInterpolate, intent); if (image == null) { var e = new ArgumentException("Failed to create CGImage"); e.Data["width"] = width; e.Data["height"] = height; e.Data["bitsPerComponent"] = bitsPerComponent; e.Data["bitsPerPixel"] = bitsPerPixel; e.Data["bytesPerRow"] = bytesPerRow; e.Data["colorSpace"] = colorSpace; e.Data["bitmapFlags"] = bitmapFlags; e.Data["dataProvider"] = dataProvider; e.Data["decode"] = decode; e.Data["shouldInterpolate"] = shouldInterpolate; e.Data["intent"] = intent; } return(image); }