c# - Show Drawing.Image in WPF -


i´ve got instance of system.drawing.image.

how can show in wpf-application?

i tried img.source not work.

i have same problem , solve combining several answers.

system.drawing.bitmap bmp; image image; ... using (var ms = new memorystream()) {     bmp.save(ms, system.drawing.imaging.imageformat.png);     ms.position = 0;      var bi = new bitmapimage();     bi.begininit();     bi.cacheoption = bitmapcacheoption.onload;     bi.streamsource = ms;     bi.endinit(); }  image.source = bi; //bmp.dispose(); //if bmp not used further. @peter 

from this question , answers


Comments

Popular posts from this blog

user interface - how to replace an ongoing process of image capture from another process call over the same ImageLabel in python's GUI TKinter -

javascript - Restarting Supervisor and effect on FlaskSocketIO -

javascript - Using jquery append to add option values into a select element not working -