Edit image source C# -


i'm trying edit image file instead of path should able provide imagesource parameter.

//editcode:

process proc = process.start(path); proc.enableraisingevents = true; processstartinfo startinfo = new processstartinfo(); startinfo.verb = "edit"; proc.startinfo = startinfo; proc.exited += new eventhandler((s, e) => myprocess_exited(s, e, obj.tostring())); 

the above code works when pass path of image file parameter. have imagesource.

//imagesourcecode:

private bitmapframe loadimage(string path) {     bitmapdecoder decoder = null;      if (file.exists(path) && (path != null))     {                            using (var stream = new filestream(path, filemode.open, fileaccess.read))        {           decoder = bitmapdecoder.create(stream, bitmapcreateoptions.none, bitmapcacheoption.onload);        }        return decoder.frames.firstordefault();     }     else         return null; } 

the above code gets path , convert image source(bitmapframe) , returns it.

now need bitmapframe passed in function , edit particular image file in paint , save it.

i neeed somthing this,

process proc = process.start(`imagesource`);// instead of path need pass image source. proc.enableraisingevents = true; processstartinfo startinfo = new processstartinfo(); startinfo.verb = "edit"; proc.startinfo = startinfo; 

how can achieve this?

you can't.

processstartinfo starts new process outside app domain of application. can't pass structures in memory within app domain command line parameter.


Comments

Popular posts from this blog

javascript - Chart.js (Radar Chart) different scaleLineColor for each scaleLine -

apache - Error with PHP mail(): Multiple or malformed newlines found in additional_header -

java - Android – MapFragment overlay button shadow, just like MyLocation button -