Back to Devexpress

ASPxBinaryImage Class

aspnet-devexpress-dot-web.md

latest6.0 KB
Original Source

ASPxBinaryImage Class

Represents an editor capable of displaying images from a binary stream.

Namespace : DevExpress.Web

Assembly : DevExpress.Web.v25.2.dll

NuGet Package : DevExpress.Web

Declaration

csharp
public class ASPxBinaryImage :
    ASPxEdit,
    IImageEdit,
    IBinaryImageEditor
vb
Public Class ASPxBinaryImage
    Inherits ASPxEdit
    Implements IImageEdit,
               IBinaryImageEditor

Remarks

The ASPxBinaryImage control can be used to display on the web page any valid image (supported by the requesting browser) taken from a binary stream.

Create a BinaryImage Control

Design Time

The ASPxBinaryImage control is available on the DX.25.2: Common Controls toolbox tab in the Microsoft Visual Studio IDE.

Drag the control onto a form and customize the control’s settings, or paste the control’s markup in the page’s source code.

aspx
<dx:ASPxBinaryImage ID="BinaryImage" runat="server" Width="200" Height="200"
    ShowLoadingImage="true" LoadingImageUrl="~/Content/Loading.gif" >
    <EditingSettings Enabled="true" />
</dx:ASPxBinaryImage>

Run Time

csharp
using DevExpress.Web;
...
protected void Page_Load(object sender, EventArgs e)
{
    ASPxBinaryImage binaryImage = new ASPxBinaryImage();
    binaryImage.ID = "BinaryImage";
    Page.Form.Controls.Add(binaryImage);

    binaryImage.Width = 200;
    binaryImage.Height = 200;
    binaryImage.ShowLoadingImage = true;
    binaryImage.LoadingImageUrl = "~/Content/Loading.gif";
    binaryImage.EditingSettings.Enabled = true;
}
vb
Imports DevExpress.Web

Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs)
    Dim binaryImage As ASPxBinaryImage = New ASPxBinaryImage()
    binaryImage.ID = "BinaryImage"
    Page.Form.Controls.Add(binaryImage)

    binaryImage.Width = 200
    binaryImage.Height = 200
    binaryImage.ShowLoadingImage = True
    binaryImage.LoadingImageUrl = "~/Content/Loading.gif"
    binaryImage.EditingSettings.Enabled = True
End Sub

Note

DevExpress controls require that you register special modules, handlers, and options in the Web.config file. You can change this file or switch to the Design tab in the Microsoft Visual Studio IDE to automatically update the Web.config file. Note that this information is automatically registered if you use the DevExpress Template Gallery to create a project.

This class inherits its basic functionality from its ancestor. The ASPxBinaryImage.ContentBytes property provides access to the editor’s contents represented by an array of bytes. The ASPxBinaryImage.StoreContentBytesInViewState property allows you to control whether the editor’s content should be stored within the editor’s view state between postbacks.

Note

Use the ASPxImage control to use the URL path to show an image from the server side.

Implements

Show 15 items

IComponent

IDisposable

IParserAccessor

IDataBindingsAccessor

IControlBuilderAccessor

IControlDesignerAccessor

IExpressionsAccessor

IAttributeAccessor

IUrlResolutionService

INamingContainer

IPostBackDataHandler

IPostBackEventHandler

ICallbackEventHandler

IPropertiesOwner

IDataSourceViewSchemaAccessor

Inheritance

Show 12 items

Object Control WebControl ASPxWebControlBase ASPxWebControl ASPxDataWebControlBase ASPxDataWebControl ASPxEditBase ASPxEdit ASPxBinaryImage BootstrapBinaryImage

MVCxBinaryImage

See Also

ASPxBinaryImage Members

BinaryImageEditProperties

Binary Image

DevExpress.Web Namespace