ASP.NET WebForms + HTTP handlers: View images from database in web image viewer.

Code samples for VintaSoft Imaging .NET SDK. Here you can request a code sample.

Moderator: Alex

Post Reply
Alex
Site Admin
Posts: 1461
Joined: Thu Jul 10, 2008 2:21 pm

ASP.NET WebForms + HTTP handlers: View images from database in web image viewer.

Post by Alex » Thu May 11, 2017 3:59 pm

In this topic we will show how to view images, which are stored in database, in ASP.NET WebForms application. Images will not be cached on the server and will be sent directly to the client.

For doing our task we need:
  • Open Visual Studio .NET 2015.
  • Create an ASP.NET WebForms application project.
  • Add the references to the Vintasoft assemblies (version 8.5.1.1) and Vintasoft JavaScript files to the project:
    • Vintasoft.Shared.dll
    • Vintasoft.Shared.Web.dll
    • Vintasoft.Imaging.dll
    • Vintasoft.Imaging.Web.Services.dll
    • Vintasoft.Imaging.Web.HttpHandlers.dll
    • Scripts\Vintasoft\Vintasoft.Shared.js
    • Scripts\Vintasoft\Vintasoft.Imaging.Svg.js
    You can add the assemblies and JavaScript files manually or automatically. Add the "Vintasoft.Imaging.Web.HttpHandlers" Nuget package to the project and the assemblies and JavaScript files will be added automatically.
  • Create a web service, which will get image from database and render image tile or thumbnail for web image viewer.
    • Create a HTP handler with name VintasoftDBImageHandler. Handler will be used for rendering of images and thumbnails.
    • Create the DataBaseImageStorage class, which will be used as a storage for images in database.
    • Create the DatabaseEmulator class, which will be used for emulating connection with database.
    • Specify that VintasoftDBImageHandler class must use DataBaseImageStorage class as a data storage for images.
  • Create a default ASPX page.
    • Add HTML (SVG) web image viewer to the default ASPX page.
    • Create 3 web images, which are linked with images stored in database.
    • Create 3 buttons. Each button allows to load image in web image viewer.

Source codes of ASP.NET WebForms application for VintaSoft Imaging .NET SDK v8.5 can be downloaded from here.

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest