Exemplo n.º 1
0
 /// <summary>
 /// Initializes a new instance of the <code>Bitmap2</code> class from the specified data stream.
 /// </summary>
 /// <param name="stream">The data stream used to load the image.</param>
 public Bitmap2(Stream stream)
 {
     if (stream == null){
         throw new ArgumentNullException();
     }
     Image2 im = new Image2(stream);
     data = new int[im.Height, im.Width];
     for (int i = 0; i < im.Pixels.Length; i++){
         Color2 c = im.Pixels[i];
         SetPixel(i%im.Width, i/im.Width, Color2.FromArgb(c.A, c.R, c.G, c.B));
     }
 }
Exemplo n.º 2
0
 public Image2(Image2 other) : base(other)
 {
     foreach (ImageFrame frame in other.Frames)
     {
         if (frame != null)
         {
             Frames.Add(new ImageFrame(frame));
         }
     }
     RepeatCount          = other.RepeatCount;
     HorizontalResolution = other.HorizontalResolution;
     VerticalResolution   = other.VerticalResolution;
     CurrentImageFormat   = other.CurrentImageFormat;
 }