DataServer.Media.PhotoReceived C# (CSharp) Method

PhotoReceived() public method

public PhotoReceived ( string id, byte newByteArray, Service s ) : void
id string
newByteArray byte
s Service
return void
        public void PhotoReceived(string id, byte[] newByteArray, Service s) {
            ByteArray = newByteArray; 
            var img = new BitmapImage();
            //using (var ms = new MemoryStream(newByteArray)) {
            //    img.BeginInit();
            //    img.StreamSource = ms;
            //    img.EndInit();                
            //}
            Image = img;
            //using (var ms = new FileStream(Path.Combine(LocalPath, id), FileMode.Create)) {
            //    var encoder = new PngBitmapEncoder();
            //    encoder.Frames.Add(BitmapFrame.Create(img));
            //    encoder.Save(ms);
            //}

            if (MediaUpdated != null) MediaUpdated(this, null);

            //LocalPath = s.store.GetLocalUrl(s.Folder, Id);
            //s.store.SaveBytes(LocalPath, content);

            //BitmapSource bs = new BitmapImage();
            //FileStore.LoadImage(content, ref bs);
            //FileStore.LoadPhoto(content, ref bs);
            //Image = bs;
        }