Go Top

2019年2月11日 星期一

[C#] OpenFileDialog Filter 所有圖檔


OpenFileDialog ofd = new OpenFileDialog();
ofd.Filter = 
@"All Image Files|*.bmp;*.ico;*.gif;*.jpeg;*.jpg;*.png;*.tif;*.tiff|
Windows Bitmap(*.bmp)|*.bmp|Windows Icon(*.ico)|*.ico|
Graphics Interchange Format (*.gif)|(*.gif)|
JPEG File Interchange Format (*.jpg)|*.jpg;*.jpeg|
Portable Network Graphics (*.png)|*.png|
Tag Image File Format (*.tif)|*.tif;*.tiff";
if (ofd.ShowDialog() == DialogResult.OK)
{
    ...
}

沒有留言:

張貼留言

Copyright © BCL BLOG | Powered by Blogger