How to use ASPxImageGallery to upload binary image?

Viewed 34

How to use ASPxImageGallery to upload binary image?

My DevExpress version is 18.1.6 and .net version is .NET Framework 4.6.1.

I have a list of image url and all converted to base64string. How can i show the base64 image in ASPxImageGallery?

The follow script is using to change the image to base64. And the result will add to ImagePath How can I show all the image in ImagePath with ASPxImageGallery?

public List<String> Worker_Photo(List<String> result)
   List<String> ImagePath = new List<String>();
   foreach (string Path in result)
   {
       ImagePath.add(Get_Base64_Worker_Photo(Path));    
   }
   return ImagePath;
}
public string Get_Base64_Worker_Photo(String Path)
{
   string Image64 = "";

   using (Image image = Image.FromFile(Path))
   {
       using (MemoryStream m = new MemoryStream())
       {
           image.Save(m, image.RawFormat);
           byte[] imageBytes = m.ToArray();

           // Convert byte[] to Base64 String
           string base64String = Convert.ToBase64String(imageBytes);
           Image64 = base64String;

       }
   }
  }

I have also read the ASPxImageGallery demo and download the demo project. But I am still not too understand how to do this. I found a database file binary_images.mdf in demo project, is the demo project is refer to database to get the binary image ? Is that mean I need to upload the base64String into database first?

0 Answers
Related