I want to save an image which has two options (.Png or .Jpeg),so i need to display only files with Png and Jpeg format, like when we choose Save type as All Images it displays all kind of images in the dialog. so how would i do that?
using(SaveFileDialog saveFileDialog1 = new SaveFileDialog())
{
saveFileDialog1.InitialDirectory = Convert.ToString(Environment.SpecialFolder.MyPictures);
saveFileDialog1.Filter = "Images (*.Png + Jpeg)|*.Png + *.Jpeg";
}
You'd be looking for a filter like this:
"Images (*.png,*.jpeg)|*.png;*.jpeg";
or optionally:
"Images (*.png,*.jpeg)|*.png;*.jpeg|All files (*.*)|*.*"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With