WPF C# Display Image after Progress Completed
User inputs data in a textbox, selects GO from the menu. This launches a background thread and a progress bar window. When complete, the background thread creates a .png (test.txt.png) based on the textbox filename (test.txt) in the same directory. All this is workin开发者_开发知识库g.
I'd like to display the .png file when complete. Can someone give me a little guidance on how to display the right .png file based on the file that is open?
Displaying the image is as simple as adding an Image
to your visual tree. Loading the bitmap data from your file is also very simple: look at the second code example here.
If you are using BackgroundWorker to create the .PNG, you could assign its filepath as a result, and access it by handling the RunWorkerCompleted event.
精彩评论