image - accessing pictures in my exe of wpf app from codebehind -


im accessing image in xaml , setting picturebox with

source="/socialshock-wpf-client;component/images/blue-bar-replication.png" 

how in codebehind?

    public static bitmapimage getimagefromresource(string name)     {         var res = new bitmapimage();         res.begininit();         res.streamsource = assembly.getexecutingassembly().getmanifestresourcestream("socialshock-wpf-client.images." + name);         res.endinit();          return res;     } 

invoke method image name, "blue-bar-replication.png" in case. image build action should set embededresource.


Comments

Popular posts from this blog

python - Scipy curvefit RuntimeError:Optimal parameters not found: Number of calls to function has reached maxfev = 1000 -

c# - How to add a new treeview at the selected node? -

java - netbeans "Please wait - classpath scanning in progress..." -