I have images in an SQL Server table that I want to display in a Dev Express ASPxImageZoom control.
This control has an ImageUrl property of type string.
I don't want to create lots of temporary files on my file server. Is there any way I can set the ImageUrl without creating a temporary file ?
I am writing a property editor for use in a Dev Express XAF application. It contains the code
protected override void ReadViewModeValueCore()
{
var zoom = (ASPxImageZoom)ZoomControl; // where ZoomControl is a WebControl
var bytes = (byte[])PropertyValue;
if (bytes.Length <= 0)
{
return;
}
var base64String = Convert.ToBase64String(bytes, 0, bytes.Length);
zoom.ImageUrl = "data:image/png;base64," + base64String; // fails if length is too long.
}
If I have a large image I get an error.
The specified path, file name, or both are too long. The fully qualified file name must be less than 260 characters, and the directory name must be less than 248 characters
The only way of setting the image for the control is via setting the ImageUrl which is a string.