private async Task <bool> isTextFileTooBig()
        {
            var textArray = this.HiddenText.StringToBitArray();
            var pixels    = PictureUtilities.ConvertBytesIntoBitArray(this.SourcePicture);

            if (textArray.Length > pixels.Length / ImageConstants.ByteLength * this.BitsPerColorChannel)
            {
                await this.showMessageCantFitDialog(textArray, pixels);

                return(true);
            }

            return(false);
        }
Exemplo n.º 2
0
        private string extractTextFromBytes()
        {
            var text       = new StringBuilder();
            var binaryText = new StringBuilder();
            var pixels     = PictureUtilities.ConvertBytesIntoBitArray(this.sourcePicture);

            for (var i = 0; i < pixels.Length; i++)
            {
                if (this.getTextFromBits(i, pixels, binaryText, text, out var extractTextFromBytes1))
                {
                    return(extractTextFromBytes1);
                }
            }

            return(text.ToString());
        }
Exemplo n.º 3
0
        private void textEmbedding(string text)
        {
            text  = this.removeNonLettersIfNotEncrypted(text);
            text += this.endOfText;
            var textArray      = text.StringToBitArray();
            var textArrayIndex = 0;
            var pixels         = PictureUtilities.ConvertBytesIntoBitArray(this.sourcePicture);

            this.MessageTooLarge = false;
            for (var i = 0; i < pixels.Length; i++)
            {
                if (this.changeBitsPerByte(i, pixels, textArray, ref textArrayIndex))
                {
                    return;
                }
            }
        }