Click here to Skip to main content
15,500,996 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I'm creating a wpf app for my SO and I need a way to display an image, currently using image tag and its working but I need a way to paste into an area that will not only display but then allow me to save.

Not sure in what direction to go.

Thought about putting a button when pressed would check clipboard and if image import and display?

Could someone point me in the right direction?

What I have tried:

Nothing yet just looking for advice.
Updated 22-Feb-21 13:02pm

1 solution

That's the general approach I took; in UWP.

I transfer the clipboard data "as image" to memory; if it's valid "image date", I create the bitmap.

The bitmap is then assigned to the source of an image control for viewing.

You could then also save the image to a file.

(In my case, the image is a "floor plan" that the user uses as a (background image) template for my "home space mapping" app).

In the case of WPF, it might be easier to save the clipboard image to a file first, and then use the file.

(UWP seems easier but I don't think it always translate well to WPF).

Saving Clipboard Images to File in C#[^]
Share this answer
Mike Hankey 22-Feb-21 19:34pm    
Thanks Gerry, that'll get me thinking.
Gerry Schmitz 23-Feb-21 1:07am    
You're welcome!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900