コード例 #1
0
        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();
        }
コード例 #2
0
        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();
        }