using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Drawing; namespace bbiwarg.DataSource { class ColorImage { private int width, height; private byte[] data; public ColorImage(int width, int height, byte[] data) { this.width = width; this.height = height; this.data = data; } public int getWidth() { return width; } public int getHeight() { return height; } public Color getColor(int x, int y) { return Color.FromArgb(data[4 * (y * width + x) + 3], data[4 * (y * width + x) + 0], data[4 * (y * width + x) + 1], data[4 * (y * width + x) + 2]); } } }