/// <summary> /// Returns singletone instance /// </summary> /// <returns>Instance</returns> public static JPEG GetInstance() { if (_instance == null) { _instance = new JPEG(); } return(_instance); }
/// <summary> /// Main form constructor /// </summary> public MainForm() { InitializeComponent(); _panels = new Hashtable(); _panels.Add(panelQuality, new List <string>() { "JPEG" }); _panels.Add(panelCompression, new List <string>() { "TIFF" }); _panels.Add(panelWaveletLevels, new List <string>() { "Wavelet+GZIP" }); _panels.Add(panelCompressionLevel, new List <string>() { "GZIP", "HInterlacing+GZIP", "VInterlacing+GZIP", "XInterlacing+GZIP", "Wavelet+GZIP" }); _panels.Add(panelInterimFormat, new List <string>() { "HInterlacing+GZIP", "VInterlacing+GZIP", "XInterlacing+GZIP", "Wavelet+GZIP" }); _panels.Add(panelFinalFormat, new List <string>() { "HInterlacing+GZIP", "VInterlacing+GZIP", "XInterlacing+GZIP", "Wavelet+GZIP" }); cmbAlgorithm.Items.Clear(); cmbAlgorithm.Items.Add(JPEG.GetInstance()); cmbAlgorithm.Items.Add(PNG.GetInstance()); cmbAlgorithm.Items.Add(TIFF.GetInstance()); cmbAlgorithm.Items.Add(GZIP.GetInstance()); cmbAlgorithm.Items.Add(HInterlacingWithGZIP.GetInstance()); cmbAlgorithm.Items.Add(VInterlacingWithGZIP.GetInstance()); cmbAlgorithm.Items.Add(XInterlacingWithGZIP.GetInstance()); cmbAlgorithm.Items.Add(WaveletWithGZIP.GetInstance()); cmbAlgorithm.SelectedIndex = 0; cmbCompression.Items.Clear(); cmbCompression.Items.Add("Default"); cmbCompression.Items.Add("None"); cmbCompression.Items.Add("CCITT3"); cmbCompression.Items.Add("CCITT4"); cmbCompression.Items.Add("LZW"); cmbCompression.Items.Add("RLE"); cmbCompression.Items.Add("ZIP"); cmbCompression.Items.Add(".NET default"); cmbCompression.SelectedIndex = 7; cmbCompressionLevel.Items.Clear(); cmbCompressionLevel.Items.Add("Optimal"); cmbCompressionLevel.Items.Add("Fast"); cmbCompressionLevel.Items.Add("None"); cmbCompressionLevel.SelectedIndex = 0; cmbInterimFormat.Items.Clear(); cmbInterimFormat.Items.Add(ImageFormat.Bmp); cmbInterimFormat.Items.Add(ImageFormat.Png); cmbInterimFormat.Items.Add(ImageFormat.Tiff); cmbInterimFormat.SelectedIndex = 0; cmbFinalFormat.Items.Clear(); cmbFinalFormat.Items.Add(ImageFormat.Bmp); cmbFinalFormat.Items.Add(ImageFormat.Png); cmbFinalFormat.Items.Add(ImageFormat.Tiff); cmbFinalFormat.SelectedIndex = 0; _resultExtension = null; }