When it comes to editing images, you may think of splitting the images into pixels and then operating these pixels to edit the images. Today we will introduce a useful class called writeablebitmap, a class that can save the UI elements as images or save the UI elements after they are converted. OK. Let's start the demo:
It is implemented in two ways: UI and postCode.
Ui implementation:
For page layout, convert the image control and textblock control into a container (I select grid)
The general XAML is as follows, where grid is named xamlgrid
Next let's take a look at how the event is handled. First, save the UI element as a writable image, then save it to the state, and display it on another page:
Page 2 accept and display
The running effect is as follows:
Next, let's take a look at the second method,Post-code implementationThis method may be more practical in practical application:
The method is very simple, that is, to translate the previous XAML in The Post code.
Running Effect
Source codeDownload: