~ubuntu-branches/ubuntu/trusty/monodevelop/trusty-proposed

« back to all changes in this revision

Viewing changes to external/monomac/src/AppKit/NSImage.cs

  • Committer: Package Import Robot
  • Author(s): Jo Shields
  • Date: 2013-05-12 09:46:03 UTC
  • mto: This revision was merged to the branch mainline in revision 29.
  • Revision ID: package-import@ubuntu.com-20130512094603-mad323bzcxvmcam0
Tags: upstream-4.0.5+dfsg
ImportĀ upstreamĀ versionĀ 4.0.5+dfsg

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
//
2
2
// Copyright 2011, Novell, Inc.
 
3
// Copyright 2012 Xamarin Inc.
3
4
//
4
5
// Permission is hereby granted, free of charge, to any person obtaining
5
6
// a copy of this software and associated documentation files (the
22
23
//
23
24
 
24
25
using System;
 
26
using System.Drawing;
 
27
 
25
28
using MonoMac.Foundation;
 
29
using MonoMac.CoreGraphics;
26
30
 
27
31
namespace MonoMac.AppKit {
28
32
 
29
33
        public partial class NSImage {
30
34
 
 
35
                public CGImage CGImage {
 
36
                        get {
 
37
                                var rect = RectangleF.Empty;
 
38
                                return AsCGImage (ref rect, null, null);
 
39
                        }
 
40
                }
 
41
 
31
42
                public static NSImage FromStream (System.IO.Stream stream)
32
43
                {
33
44
                        using (NSData data = NSData.FromStream (stream)) {
34
45
                                return new NSImage (data);
35
46
                        }
36
47
                }
 
48
 
 
49
                // note: if needed override the protected Get|Set methods
 
50
                public string Name { 
 
51
                        get { return GetName (); }
 
52
                        // ignore return value (bool)
 
53
                        set { SetName (value); }
 
54
                }
 
55
        }
 
56
 
 
57
        public partial class NSImageRep {
 
58
 
 
59
                public CGImage CGImage {
 
60
                        get {
 
61
                                var rect = RectangleF.Empty;
 
62
                                return AsCGImage (ref rect, null, null);
 
63
                        }
 
64
                }
37
65
        }
38
66
}