public static void OpenTakeover(string hook, string orientation, MonoTouch.UIKit.UIImage image, string message, NSDictionary userCookies) { if (hook == null) { throw new ArgumentNullException("hook"); } if (orientation == null) { throw new ArgumentNullException("orientation"); } if (image == null) { throw new ArgumentNullException("image"); } if (message == null) { throw new ArgumentNullException("message"); } if (userCookies == null) { throw new ArgumentNullException("userCookies"); } var nshook = new NSString(hook); var nsorientation = new NSString(orientation); var nsmessage = new NSString(message); Messaging.void_objc_msgSend_IntPtr_IntPtr_IntPtr_IntPtr_IntPtr(class_ptr, selOpenTakeoverOrientationRewardImageRewardMessageUserCookies, nshook.Handle, nsorientation.Handle, image.Handle, nsmessage.Handle, userCookies.Handle); nshook.Dispose(); nsorientation.Dispose(); nsmessage.Dispose(); }
public static IObservable<NSImage> BytesToImage(byte[] compressedImage) { try { var ret = new NSImage(NSData.FromArray(compressedImage)); return Observable.Return(ret); } catch (Exception ex) { return Observable.Throw<NSImage>(ex); } }
public static MonoTouch.UIKit.UIImage ImageFromByteArray(byte[] data) { if (data == null) { return null; } MonoTouch.UIKit.UIImage image; try { image = new MonoTouch.UIKit.UIImage(MonoTouch.Foundation.NSData.FromArray(data)); } catch (Exception e) { Console.WriteLine ("Image load failed: " + e.Message); return null; } return image; }
public static MonoTouch.UIKit.UIImage ImageFromByteArray(byte[] data) { if (data == null) { return(null); } MonoTouch.UIKit.UIImage image; try { image = new MonoTouch.UIKit.UIImage(MonoTouch.Foundation.NSData.FromArray(data)); } catch (Exception e) { Console.WriteLine("Image load failed: " + e.Message); return(null); } return(image); }
public static byte[] ResizeImageIOS(byte[] imageData, float width, float height) { UIImage originalImage = ImageFromByteArray(imageData); //create a 24bit RGB image using (CGBitmapContext context = new CGBitmapContext(IntPtr.Zero, (int)width, (int)height, 8, (int)(4 * width), CGColorSpace.CreateDeviceRGB(), CGImageAlphaInfo.PremultipliedFirst)) { RectangleF imageRect = new RectangleF(0, 0, width, height); // draw the image context.DrawImage(imageRect, originalImage.CGImage); MonoTouch.UIKit.UIImage resizedImage = MonoTouch.UIKit.UIImage.FromImage(context.ToImage()); // save the image as a jpeg return(resizedImage.AsJPEG().ToArray()); } }
public ReactiveImageView(NSImage image, NSImage highlightedImage) : base(image, highlightedImage) { setupRxObj(); }
public ReactiveImageView(NSImage image) : base(image) { setupRxObj(); }
protected ReactiveImageView(NSImage image, NSImage highlightedImage) : base(image, highlightedImage) { }
protected ReactiveImageView(NSImage image) : base(image) { }
public ReactiveImageView(NSImage image, NSImage highlightedImage) : base(image, highlightedImage) { }
public ReactiveImageView(NSImage image) : base(image) { }
protected override void HandleFrame(MonoTouch.UIKit.UIImage f) { base.HandleFrame(f); LayoutAnnotations(); }