private void ManageEncoding(string path) { ApifEncoder encoder = new ApifEncoder(); encoder.SetStatusHandler(SetStatus, this); byte[] file = encoder.Encode(image); File.WriteAllBytes(path, file); conversionProgressLabel.Text = encoder.GetEncodingTime().TotalMilliseconds.ToString("F1") + " ms"; compressionLabel.Text = encoder.GetCompressionRate().ToString("F3"); compressionTypeLabel.Text = encoder.GetCompressionType().ToString(); }
private void ManageDecoding(string path) { ApifEncoder encoder = new ApifEncoder(); encoder.SetStatusHandler(SetStatus, this); image = encoder.Decode(File.ReadAllBytes(path)); imagepreview.Image = image; conversionProgressLabel.Text = encoder.GetEncodingTime().TotalMilliseconds.ToString("F1") + " ms"; compressionLabel.Text = encoder.GetCompressionRate().ToString("F3"); compressionTypeLabel.Text = encoder.GetCompressionType().ToString(); }