public void SaveImage(string savePath, PicFormat saveFormat) { string saveName = FileName + "." + saveFormat; string filepath = Path.Combine(savePath, saveName); switch (saveFormat) { case PicFormat.png: originImage.Save(filepath, new PngEncoder()); break; case PicFormat.gif: originImage.Save(filepath, new GifEncoder()); break; case PicFormat.jpg: originImage.Save(filepath, new JpegEncoder { Quality = 80 }); break; } }
private void FormatList_SelectionChanged(object sender, SelectionChangedEventArgs e) { format = (PicFormat)(formatList.SelectedIndex); //false focus for "unfocus" ComboBox widthSlider.Focus(); }