I have an ASP.NET control on a form. Declared as:
<asp:imagebutton runat=”server” Id=”myImage1″/>
In the code behind, I get an image from a Redis database. I read the image into memory. Like so:
Dim myByteArray() As Byte = myRedisDb.StringGet(myImageName)
I have tested the byte array by writing it to disk and then opening the disk file. Using the following code:
<code> System.IO.File.WriteAllBytes("D:TempmyImage.png", myByteArray)
myImage1.ImageUrl = "D:TempmyImage.png"
</code>
<code> System.IO.File.WriteAllBytes("D:TempmyImage.png", myByteArray)
myImage1.ImageUrl = "D:TempmyImage.png"
</code>
System.IO.File.WriteAllBytes("D:TempmyImage.png", myByteArray)
myImage1.ImageUrl = "D:TempmyImage.png"
How do I assign this byte to the control without having to write it to disk first?
The whole point of using Redis is to speed up performance. The disk write and disk read are not efficient.