Exemple #1
0
        /// <summary>
        /// Creates space in each color value (R,G,B) based upon BlockSize
        /// </summary>
        /// <param name="pixel">Individual pixel</param>
        /// <returns>Pixel with altered color to allow for inserting space</returns>
        private Color MakeSpaceInPixel(Color pixel)
        {
            int   red      = BitBlock.MakeStorageSpace(pixel.R, BlockSize);
            int   green    = BitBlock.MakeStorageSpace(pixel.G, BlockSize);
            int   blue     = BitBlock.MakeStorageSpace(pixel.B, BlockSize);
            Color newColor = Color.FromArgb(red, green, blue);

            return(newColor);
        }
Exemple #2
0
        /// <summary>
        /// Decodes message in image using the ImageBMP.
        /// </summary>
        public void ExtractMessage()
        {
            List <int> messNums = new List <int>();

            for (int x = 0; x < ImageBMP.Width; x++)
            {
                for (int y = 0; y < ImageBMP.Height; y++)
                {
                    Color pixelColor = ImageBMP.GetPixel(x, y);
                    messNums.Add(BitBlock.GetMod(pixelColor.R, BlockSize));
                    messNums.Add(BitBlock.GetMod(pixelColor.G, BlockSize));
                    messNums.Add(BitBlock.GetMod(pixelColor.B, BlockSize));
                }
            }
            MessageArray = ToTwoDemArray(messNums.ToArray());
            string temp = BitBlock.BinaryToMessage(MessageArray, BlockSize);

            Message = temp;
        }