Skip to content

Instantly share code, notes, and snippets.

@ganwell
Created February 6, 2012 21:18
Show Gist options
  • Save ganwell/1754954 to your computer and use it in GitHub Desktop.
Save ganwell/1754954 to your computer and use it in GitHub Desktop.
Quick Look to TIFF
CFUrl url = CFUrl.FromUrlString("file:///Users/ganwell/Desktop/Untitled.png", null);
CGImage img = QuickLook.ThumbnailImageCreate(url, new SizeF(256, 256), new NSDictionary());
NSImage nsimg = new NSImage(img, new SizeF(256, 256));
NSObject obj = Runtime.GetNSObject
(MonoMac.ObjCRuntime.Messaging.IntPtr_objc_msgSend (nsimg.Handle, Selector.GetHandle("TIFFRepresentation")));
NSData data = obj as NSData; //-> null.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment