OpenFileDialog openFileDlg = new OpenFileDialog();
openFileDlg.Title = " Select File ";
openFileDlg.Multiselect = false;
openFileDlg.InitialDirectory=Environment.GetFolderPath(Environment.SpecialFolder.Desktop);// Set the default path to desktop
openFileDlg.Filter = "(*.jpg,*.png,*.jpeg,*.bmp,*.gif)|*.jgp;*.png;*.jpeg;*.bmp;*.gif|All files(*.*)|*.*"; // Format multiple files
if (openFileDlg.ShowDialog() == DialogResult.OK)
{
String filePath = openFileDlg.FileName;
this.pictureBox1.SizeMode = PictureBoxSizeMode.StretchImage;
this.pictureBox1.ImageLocation = filePath;// After selecting a photo, click PictureBox It shows that
}

OpenfileDialog Choose more articles about simple applications of photos

  1. How to be compatible with all Android Select a photo or take a picture and then crop the picture -- be based on FileProvider And the implementation of dynamic permissions

    We know , Android The operating system has been evolving . Although the system is more and more secure , reliable , But for developers , Development is becoming more and more difficult , Compatibility issues to pay attention to , More and more . Like in Android Take photos on the platform or ...

  2. android: Select photos from the album

    Although it's convenient and quick to use the camera to take photos , But not every time we need to take a picture on the spot . Because everyone's cell phone album should have many photos , Pick an existing photo directly from the album It's more common to take a picture than to turn on the camera . An excellent person ...

  3. Swift - Use UIImagePickerController Select photos from the album and show them

    1,UIImagePickerController Introduce (1) Choose the pictures in the album or take photos , It's all through UIImagePickerController The controller instantiates an object , And then through self.presentVi ...

  4. h5 Call the system to take photos or select photos and preview

    Here's another good thing to share ! Call the mobile phone camera to take photos or call the mobile phone album to select photos , This function is Mobile page perhaps webApp It should be common to , Take personal or member data entry as an example, which is often encountered , Whenever you see this function ...

  5. [Swift] Eight sorting algorithms ( 3、 ... and ): Selection sort and Simple selection sort

    Sorting is divided into internal sorting and external sorting . Internal sorting : It refers to the sorting process in which the sequence to be arranged is completely stored in memory , Suitable for not too large element sequences . External sorting : It refers to the sorting of large files , That is, the records to be sorted are stored in the external memory , The file to be sorted cannot be loaded into memory at one time ...

  6. HTML5: Call the system to take photos or select photos and preview

    ylbtech-HTML5:  Call the system to take photos or select photos and preview 1. Return to the top 1. <!DOCTYPE html> <html> <head> <meta ...

  7. Android Develop template code ( One )—— Simply open the gallery and select photos

    First , Paste the sample code first // Check authority public void checkPermission() { if (ContextCompat.checkSelfPermission(this, Manife ...

  8. swift - Select photos from the album and upload

    Selecting local images and uploading them is a common function in application development .        Original text :www.hangge.com   Reprint please keep the original link :http://www.hangge.com/blog/cache/det ...

  9. python Study (6) Simple code for sorting algorithm selection

    The basic idea of selective sequencing is : Every time n-i+1(i=1,2,…n-1) The record with the smallest keyword is selected as the record in the ordered sequence i A record . The algorithm based on this idea mainly has simple selection sort . Tree selection sort and heap sort .[1] Simply select the base of the sort ...

Random recommendation

  1. following C# The output of the program is ( ).

    The output of the following program is ( ). using System; namespace HoverTreeTikuConsole { class Program { static void Main(strin ...

  2. HTML Table border setting tips

    For many beginners HTML For people who , form <table> It's the most commonly used label , But for the control of table borders , Many beginners don't know much about it . For many beginners HTML For people who , form <table> It's the most commonly used label ...

  3. ThinkPHP 3.2 What has the version upgraded

    ThinkPHP 3.2 What has the version upgraded           ThinkPHP 3.2 It's been released for a long time , Here's a summary of this ThinkPHP 3.2 What happened , Convenient for programmers to develop . Preface T ...

  4. Codeforces Round #215 (Div. 2) B. Sereja and Suffixes map

    B. Sereja and Suffixes Time Limit: 20 Sec Memory Limit: 256 MB Topic linking http://codeforces.com/problemset ...

  5. MVCC Icon

    Honing technology, Zhuji , Practice the way of data , Pursuit of outstanding value Back to the previous page :PostgreSQL Internal structure and source code research index page     Back to the top page :PostgreSQL Index page [ author : Gao Jian @ Blog Garden luckyjackgao ...

  6. js utilize ajax load js , Show loading progress , Strictly in accordance with js The order of loading to the page

    js utilize ajax load js , Show loading progress , Strictly in accordance with js The order of loading to the page , When doing mobile terminal development , Find a problem , Some browsers , In the case of slow network speed ,js The file is not finished loading , Subsequent calls have already started , ...

  7. process , Threads , coroutines , asynchronous IO Knowledge point

    process : qq To be exposed to OS management as a whole , It contains calls to various resources , Memory management , Network interface call, etc ... A collection of resource management Can be   process Threads : Is the smallest scheduling unit of the operating system , It's a string of instructions ...

  8. oss Object cloud storage

    import qiniu import uuidimport config def qn_upload_voice(fileData): ''' Upload voice to 7niuyun @arg: fileData - code ...

  9. C# ManualResetEventSlim Realization

    ManualResetEventSlim Through encapsulation  ManualResetEvent Provides a combination of spin wait and kernel wait . If cross process or cross AppDomain Synchronization of , Then you have to use ManualResetEv ...

  10. 『 Computer vision 』Mask-RCNN_ One of the training networks : The data set and Dataset class

    Github Address :Mask_RCNN 『 Computer vision 』Mask-RCNN_ Thesis study 『 Computer vision 』Mask-RCNN_ Project document translation 『 Computer vision 』Mask-RCNN_ One of the inference networks : The overview 『 Computer vision 』M ...