I have a WPF app. My main project references another project (My.Tools.Images) within the solution. My.Tools.Images project contains some images.
Then from main project I am trying to read all bytes from SampleImage.png file located in that referenced project 'My.Tools.Images' by creating an Uri and later in some way, convert it into a byte array:
Uri myUri = new Uri("/My.Tools.Images;component/Files/SampleImage.png", UriKind.Relative);
... but once created the Uri I do not know how to read all bytes from there, I mean, convert SampleImage.png into a byte array.
How can I do this?
Note: I want to avoid to keep a link with the SampleImage.png opened from disk because later I need to delete this file from another place, so if this file is in use (opened), I cannot delete it.