Inserting Images in a Window

I assume you are familiar with inserting images into a window using scripting and or framework design based languages but this article will provide you a touch of inserting images in a window using C#. You can select any type of image, in any format like:

Functioning

The process of inserting images in a window is quite easy and simple. You only need to create several sets of file formats to be inserted.
Afterwards the procedure will follow like this-

Procedure


There is no complexity in this application, what you only need to follow is basic operations of Visual Studio and knowledge of C#.NET. Here we go.

Step 1

Step 2: Perform the actions required for it, like call, handling and so on.

Coding

The code will go like this:

using System;

using System.Collections.Generic;

using System.Linq;

using System.Web;

using System.Web.UI;

using System.Web.UI.WebControls;

using System.Data.SqlClient;

public MainPage()

{

this.InitializeComponent();

}

/// <summary>

/// Invoked when this page is about to be displayed in a Frame.

/// </summary>

/// <param name="e">Event data that describes how this page was reached. The Parameter

/// property is typically used to configure the page.</param>

protected override void OnNavigatedTo(NavigationEventArgs e)

{

}

private async void button1_Click(object sender, RoutedEventArgs e)

{

FileOpenPicker openpicker = new FileOpenPicker();

openpicker.ViewMode = PickerViewMode.Thumbnail;

openpicker.SuggestedStartLocation = PickerLocationId.PicturesLibrary;

openpicker.FileTypeFilter.Add(".jpg");

openpicker.FileTypeFilter.Add(".jpeg");

openpicker.FileTypeFilter.Add(".png");

// picking file formats

StorageFile file = await openpicker.PickSingleFileAsync();

}