Pulse7
8/19/2017 - 11:32 AM

Embedding image and accessing it

Embedding image and accessing it

//this also works
ProjectFolder
  Assets
    wallhaven20.png  ** Build action:Content | Copy:Copy if newer

<Image Source="Assets/wallhaven20.png"></Image>

resulting bin folder:
bin
  Debug
    Assets
      wallhaven20.png
    Project.exe //No image 10mb
    Project.pdb
    Project.exe.config
//this  works
ProjectFolder
  Assets
    wallhaven20.png  ** Build action:Resource | Copy:Do not copy

<Image Source="Assets/wallhaven20.png"></Image>
<Image Source="/Assets/wallhaven20.png"></Image>

resulting bin folder:
bin
  Debug
    Project.exe //image embedded 20mb
    Project.pdb
    Project.exe.config
//this also works
ProjectFolder
  Assets
    wallhaven20.png  ** Build action:Resource | Copy:Do not copy

<Image Source="pack://application:,,,/PathGeometry;component/Assets/wallhaven20.png"></Image>

resulting bin folder:
bin
  Debug
    Project.exe //image embedded 20mb
    Project.pdb
    Project.exe.config
//this also works
ProjectFolder
  Assets
    wallhaven20.png  ** Build action:Resource | Copy:Do not copy

<Image Source="/PathGeometry;component/Assets/wallhaven20.png"></Image>

resulting bin folder:
bin
  Debug
    Assets
      wallhaven20.png
    Project.exe //image embedded 20mb
    Project.pdb
    Project.exe.config