/// <summary> /// <para>Constructs a new <see cref="T:Xsharp.Image"/> instance /// that represents an off-screen image that was loaded /// from a file.</para> /// </summary> /// /// <param name="screen"> /// <para>The screen upon which to create the new pixmap.</para> /// </param> /// /// <param name="filename"> /// <para>The file to load the image from.</para> /// </param> /// /// <exception cref="T:System.ArgumentNullException"> /// <para>The <paramref name="filename"/> parameter is /// <see langword="null"/>.</para> /// </exception> /// /// <exception cref="T:System.FormatException"> /// <para>The image format is not recognized.</para> /// </exception> /// /// <exception cref="T:Xsharp.XInvalidOperationException"> /// <para>Raised if <paramref name="filename"/> could not be /// loaded for some reason.</para> /// </exception> public Image(Screen screen, String filename) { Display dpy; if (filename == null) { throw new ArgumentNullException("filename"); } if (screen != null) { dpy = screen.DisplayOfScreen; } else { dpy = Application.Primary.Display; screen = dpy.DefaultScreenOfDisplay; } this.screen = screen; DotGNU.Images.Image img = new DotGNU.Images.Image(); img.Load(filename); Frame frame = img.GetFrame(0); try { dpy.Lock(); pixmapXImage = ConvertImage.FrameToXImage(screen, frame); maskXImage = ConvertImage.MaskToXImage(screen, frame); } finally { dpy.Unlock(); } }
// Load the icon contents from a stream, and then set the // current frame to the first one in the icon image. private void Load(Stream stream) { image = new DotGNU.Images.Image(); image.Load(stream); frame = image.GetFrame(0); frameNum = 0; }
public static Image FromStream (Stream stream, bool useEmbeddedColorManagement) { DotGNU.Images.Image image = new DotGNU.Images.Image(); image.Load(stream); return(new Bitmap(image)); }
public static Image FromFile (String filename, bool useEmbeddedColorManagement) { DotGNU.Images.Image image = new DotGNU.Images.Image(); image.Load(filename); return(new Bitmap(image)); }
internal Image(SerializationInfo info, StreamingContext context) { // Do we need to Handle PixelFormats ?. byte[] data = null; data = (byte[])info.GetValue("Data", typeof(byte[])); MemoryStream stream = new MemoryStream(data,false); DotGNU.Images.Image dgImage = new DotGNU.Images.Image(); dgImage.Load(stream); SetDGImage(dgImage); }
internal Image(SerializationInfo info, StreamingContext context) { // Do we need to Handle PixelFormats ?. byte[] data = null; data = (byte[])info.GetValue("Data", typeof(byte[])); MemoryStream stream = new MemoryStream(data, false); DotGNU.Images.Image dgImage = new DotGNU.Images.Image(); dgImage.Load(stream); SetDGImage(dgImage); }
public Bitmap(Type type, String resource) { Stream stream = GetManifestResourceStream(type, resource); if (stream == null) { throw new ArgumentException(S._("Arg_UnknownResource")); } try { DotGNU.Images.Image dgImage = new DotGNU.Images.Image(); dgImage.Load(stream); SetDGImage(dgImage); } finally { stream.Close(); } }
/// <summary> /// <para>Constructs a new <see cref="T:Xsharp.Image"/> instance /// that represents an off-screen image that was loaded /// from a file.</para> /// </summary> /// /// <param name="screen"> /// <para>The screen upon which to create the new pixmap.</para> /// </param> /// /// <param name="filename"> /// <para>The file to load the image from.</para> /// </param> /// /// <exception cref="T:System.ArgumentNullException"> /// <para>The <paramref name="filename"/> parameter is /// <see langword="null"/>.</para> /// </exception> /// /// <exception cref="T:System.FormatException"> /// <para>The image format is not recognized.</para> /// </exception> /// /// <exception cref="T:Xsharp.XInvalidOperationException"> /// <para>Raised if <paramref name="filename"/> could not be /// loaded for some reason.</para> /// </exception> public Image(Screen screen, String filename) { Display dpy; if(filename == null) { throw new ArgumentNullException("filename"); } if(screen != null) { dpy = screen.DisplayOfScreen; } else { dpy = Application.Primary.Display; screen = dpy.DefaultScreenOfDisplay; } this.screen = screen; DotGNU.Images.Image img = new DotGNU.Images.Image(); img.Load(filename); Frame frame = img.GetFrame(0); try { dpy.Lock(); pixmapXImage = ConvertImage.FrameToXImage(screen, frame); maskXImage = ConvertImage.MaskToXImage(screen, frame); } finally { dpy.Unlock(); } }
public static Image FromStream (Stream stream, bool useEmbeddedColorManagement) { DotGNU.Images.Image image = new DotGNU.Images.Image(); image.Load(stream); return new Bitmap(image); }
public static Image FromFile (String filename, bool useEmbeddedColorManagement) { DotGNU.Images.Image image = new DotGNU.Images.Image(); image.Load(filename); return new Bitmap(image); }
public Bitmap(Type type, String resource) { Stream stream = GetManifestResourceStream(type, resource); if(stream == null) { throw new ArgumentException(S._("Arg_UnknownResource")); } try { DotGNU.Images.Image dgImage = new DotGNU.Images.Image(); dgImage.Load(stream); SetDGImage(dgImage); } finally { stream.Close(); } }
public Bitmap(String filename, bool useIcm) { DotGNU.Images.Image dgImage = new DotGNU.Images.Image(); dgImage.Load(filename); SetDGImage(dgImage); }
public Bitmap(Stream stream, bool useIcm) { DotGNU.Images.Image dgImage = new DotGNU.Images.Image(); dgImage.Load(stream); SetDGImage(dgImage); }