/// <summary> /// Loads the message. /// @Precondition none /// @Postcondition message file is loaded into the program /// </summary> public async Task LoadMessage() { this.messageFile = await this.fileReader.SelectMessageFile(); if (this.messageFile == null) { return; } if (this.MessageFileType.Equals(FileTypeConstants.TextFileType)) { this.messageEmbedder = new TextMessageEmbedder(); this.TextFromFile = await this.fileReader.ReadTextFromFile(this.messageFile); } else { this.messageEmbedder = new MonochromeImageEmbedder(); this.MessageImage = await FileBitmapConverter.ConvertFileToBitmap(this.messageFile); } if (this.SourceImage != null) { var sourceImagePixels = await PixelExtracter.ExtractPixelDataFromFile(this.sourceImageFile); this.messageEmbedder.SourceImagePixels = sourceImagePixels; } }
/// <summary> /// Initializes a new instance of the <see cref="EmbedManager" /> class. /// </summary> public EmbedManager() { this.fileReader = new FileReader(); this.fileWriter = new FileWriter(); this.messageEmbedder = null; this.messageFile = null; }