/// <summary> /// Initializes a new instance of the <see cref="EncodeForm" /> class. /// </summary> /// <param name="spawnLoc">The spawn loc.</param> /// <param name="eProg">The e prog.</param> public EncodeForm(Point spawnLoc, StegoEncode stegEncode) { InitializeComponent(); this.MaximumSize = this.Size; this.MinimumSize = this.Size; this.StartPosition = FormStartPosition.Manual; this.Location = spawnLoc; PictureSelectFile.Image = Properties.Resources.Error; PictureBoxBase64.Image = Properties.Resources.Warning; if (stegEncode == null) { return; } this.StegEncode = stegEncode; this.StegEncode.OutputFile = stegEncode.OutputFile; if (stegEncode.FilePath != null) { LblFile.Text = stegEncode.FilePath; } // Fixes icon for PictureSelectFile if (this.StegEncode.PixelLoaded) { PictureSelectFile.Image = Properties.Resources.Ready; } else { LoadFile(this.StegEncode.FilePath); } }
/// <summary> /// Loads the selected file /// </summary> private async void LoadFile(string file) { if (StegEncode == null) { StegEncode = new StegoEncode(file); } LblFile.Text = StegEncode.FilePath; PictureSelectFile.Image = Properties.Resources.Loading; await Task.Run(() => StegEncode.StartLoadingPixelsAsync()); PictureSelectFile.Image = Properties.Resources.Ready; }
/// <summary> /// Initializes a new instance of the <see cref="DecodeForm"/> class. /// </summary> /// <param name="loc">The loc.</param> /// <param name="EncodeProg">The encode prog.</param> public DecodeForm(Point loc, StegoEncode stegEncode) { InitializeComponent(); this.MaximumSize = this.Size; this.MinimumSize = this.Size; this.StartPosition = FormStartPosition.Manual; this.Location = loc; this.StegEncode = stegEncode; PictureSelectFile.Image = Properties.Resources.Error; }