internal ConcreteImage(Color[] masterImageData) { if (masterImageData.Length != 76800) { throw new ArgumentException(); } this.ByteData = ConcreteImage.ConvertToByteDataFrom(masterImageData); this.Region = new Rectangle(Point.Empty, new Size(320, 240)); }
internal ConcreteImage(Size size, Point leftTop, Color[] imageData) { if (size.Width * size.Height != imageData.Length) { throw new ArgumentException(); } Color[] color = new Color[76800]; for (int index1 = 0; index1 < size.Height; ++index1) { for (int index2 = 0; index2 < size.Width; ++index2) { color[(index1 + leftTop.Y) * 320 + (index2 + leftTop.X)] = imageData[index1 * size.Width + index2]; } } this.ByteData = ConcreteImage.ConvertToByteDataFrom(color); this.Region = new Rectangle(leftTop, size); }