ume05rw / SharpCifs.Std

SharpCifs.Std is a port from SharpCifs to .NET Standard. Original SharpCifs: https://github.com/zinkpad/SharpCifs
GNU Lesser General Public License v2.1
86 stars 34 forks source link

How can load image #23

Closed bogdan-voitovych closed 6 years ago

bogdan-voitovych commented 6 years ago

How I can load image to button from local folder?

bogdan-voitovych commented 6 years ago
       This is work for me. Thanks.
       var file = new SmbFile("smb://@192.168.1.102/Pictures/start.png");
        var readStream = file.GetInputStream();
        var memStream = new MemoryStream();
        ((Stream)readStream).CopyTo(memStream);
        ImageSource ProfileImage = ImageSource.FromStream(() => new MemoryStream(memStream.ToArray())); //Conver from chararray to image
        Image1.Source = ProfileImage; //xaml name:
bogdan-voitovych commented 6 years ago
       This is work for me. Thanks.

       var file = new SmbFile("smb://@192.168.1.102/Pictures/start.png");
        var readStream = file.GetInputStream();
        var memStream = new MemoryStream();
        ((Stream)readStream).CopyTo(memStream);

        ImageSource ProfileImage = ImageSource.FromStream(() => new MemoryStream(memStream.ToArray())); //Conver from chararray to image
        Image1.Source = ProfileImage; 

//xaml name