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

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

Android soft keyboard reverts to default keyboard on orientation change -

jquery - javascript onscroll fade same class but with different div -