Beispiel #1
0
        public PNGPixel GetPixel()
        {
            int        offset = Math.Abs(BitConverter.ToInt32(bytes.GetBytes(4), 0)) % coords.Count;
            PixelCoord pix    = coords[offset];

            coords.RemoveAt(offset);

            //Console.WriteLine("(" + pix.x + ", " + pix.y + ")");
            return(png.lines[pix.x][pix.y]);
        }
Beispiel #2
0
        private void initCoords()
        {
            coords.Clear();
            for (int x = 0; x < png.lines.Count; x++)
            {
                for (int y = 0; y < png.lines[x].Length; y++)
                {
                    /* skip 0,0 thru 0,10 - for the salt */

                    /*if (x > 0 || y > 10)
                     * {*/
                    PixelCoord pc = new PixelCoord()
                    {
                        x = x, y = y
                    };

                    coords.Add(pc);
                    /*}*/
                }
            }
        }