noName NoName

noName NoName

  • NA
  • 6
  • 10.9k

How to Convert Image to Byte[] in Silverlight From Client Side ??

May 2 2012 4:48 AM

Hi all,

I have been using with this problem for three days. If you help me , I will approciate you..

I have an image (.png) in a folder at project ( at Client side in project ). There is an object which have a property like "Image". Type of this property is  byte array. I just want to read this image and set this image to my object "Image " property.

As a solution , I tried to read image and convert it into byte array. But I couldn't apply it . After that I find the File.ReadAllBytes(string path) method as another solution. When I give any path for this method , it casts the path to C:\

EX: For path : MyProject\Folders\Images\MyImage.png

It converts the path to => C:\MyProject\Folders\Images\MyImage.png and could not find the image because there isn't any path like this.


Answers (3)