c# - How can i save picture in a WPF project -


this question has answer here:

so have wpf app, there have drawingvisual object, let's call "visual", there rendertargetbitmap object, let's call "target". have strings of code below.

drawingvisual visual = new drawingvisual(); rendertargetbitmap target = new rendertargetbitmap(certbg.pixelwidth, certbg.pixelheight, 96, 96, pixelformats.default); target.render(visual); image img = new image(); img.source = target; 

how can save picture? thought use img.save, doesn't work in wpf. i've tried use bitmapencoder unsuccsessful. how shall save on disk picture?


Comments

Popular posts from this blog

Is there a better way to structure post methods in Class Based Views -

reflection - How to access the object-members of an object declaration in kotlin -

php - Doctrine Query Builder Error on Join: [Syntax Error] line 0, col 87: Error: Expected Literal, got 'JOIN' -