AmaroK86.ImageFormat.DDSImage.readLinearImage C# (CSharp) Method

readLinearImage() private method

private readLinearImage ( byte imgData, int w, int h ) : Bitmap
imgData byte
w int
h int
return System.Drawing.Bitmap
        private Bitmap readLinearImage(byte[] imgData, int w, int h)
        {
            Bitmap res = new Bitmap(w, h);
            int ptr = 0;
            for (int y = 0; y < h; y++)
                for (int x = 0; x < w; x++)
                    res.SetPixel(x, y, Color.FromArgb(Buffer.GetByte(imgData, ptr++)));

            return res;
        }