diff --git a/src/AppKit/NSImage.cs b/src/AppKit/NSImage.cs index 7bb76bb803e5..b514b37b1a81 100644 --- a/src/AppKit/NSImage.cs +++ b/src/AppKit/NSImage.cs @@ -88,6 +88,14 @@ public static NSImage FromStream (System.IO.Stream stream) } } + public NSImage (string fileName, bool lazy) + { + if (lazy) + Handle = InitByReferencingFile (fileName); + else + Handle = new NSImage (fileName).Handle; + } + public NSImage (NSData data, bool ignoresOrientation) { if (ignoresOrientation) { diff --git a/src/appkit.cs b/src/appkit.cs index 3b9e5e0cd558..28255d5e0ce9 100644 --- a/src/appkit.cs +++ b/src/appkit.cs @@ -8183,8 +8183,6 @@ public partial interface NSImage : NSCoding, NSCopying, NSSecureCoding, NSPasteb [Export ("initWithContentsOfURL:")] IntPtr Constructor (NSUrl url); - //[Export ("initByReferencingFile:")] - //IntPtr Constructor (string fileName); //[Export ("initByReferencingURL:")] //IntPtr Constructor (NSUrl url); @@ -8192,6 +8190,9 @@ public partial interface NSImage : NSCoding, NSCopying, NSSecureCoding, NSPasteb //[Export ("initWithIconRef:")] //IntPtr Constructor (IconRef iconRef); + [Export ("initByReferencingFile:"), Internal] + IntPtr InitByReferencingFile (string name); + [Export ("initWithPasteboard:")] IntPtr Constructor (NSPasteboard pasteboard);