Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions src/AppKit/NSImage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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 = InitWithContentsOfFile (fileName);
}

public NSImage (NSData data, bool ignoresOrientation)
{
if (ignoresOrientation) {
Expand Down
8 changes: 6 additions & 2 deletions src/appkit.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8183,15 +8183,19 @@ 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);

// FIXME: need IconRec
//[Export ("initWithIconRef:")]
//IntPtr Constructor (IconRef iconRef);

[Sealed, Export ("initWithContentsOfFile:"), Internal]
IntPtr InitWithContentsOfFile (string fileName);

[Export ("initByReferencingFile:"), Internal]
IntPtr InitByReferencingFile (string name);

[Export ("initWithPasteboard:")]
IntPtr Constructor (NSPasteboard pasteboard);

Expand Down