c# - WPF Image to string and string to image -
i have data driven application , 1 of entities supposed have image attached it. now, since i'm putting images in sub-folder of project directory don't need serialize actual image binary file, path it. image selected listbox
contains thumbnails , should displayed on image panel in dialogue (when appropriate entity selected)
i can't seem extract path actual image
. listbox
bound object of type image
in viewmodel
, there should extracting path , placing in constructor of object.
the other thing need access image using path, in dialogue. basically, in table of entities have details panel shows attributes of selected entity, how go displaying image if have it's path?
ok, solved issue using bitmapimage
instead of image
. accessed absolute path, via urisource
property, after split string, using \
splitter argument.
i accessed last element of array of strings formed split method save name of image. after matter of creating new bitmap image given uri
using following parameter:
path.getdirectoryname(process.getcurrentprocess().mainmodule.filename) + app.mypicturefolder + mypicturename
where mypicturefolder static string variable whichc contains name of appropriate folder. might not best method, works enough me.
Comments
Post a Comment