In Windows Phone, we may have the following requirement: custom applications Program.
The actual process is as follows: select an image, save it to an isolated bucket, and load the image to make it a background image at the next startup or immediately.
The following uses a specific demo to implement this requirement:
Create a Windows Phone project, drag and drop two buttons on the interface, named "open" and "LOAD". One button is used to open the local image, and the other button is used to copy and set the background image.
Click the OPEN button to open the local image, that is, to start an event in the photochoosertask button. CodeAs follows:
Click the Load button to read the image from the isolated bucket and set it as the background of the application. The Load button Event code is as follows:
Let's take a look at the two encapsulated methods:
Save images to local storage
Read images from local storage
OK, test it...Source code:
WP7 save and load images