Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6796457
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T18:29:30+00:00 2026-05-26T18:29:30+00:00

Is it advisable to use a handler to display Images ? the issue is

  • 0

Is it advisable to use a handler to display Images ? the issue is i cannot right click and save these images .It shows the Handler name and Asp.net Generic handler as save type so i cant save the image but the GUI image is amazing in quality.I am showing a single image in different sizes using 2 handlers and the code works fine but if then if I don’t use the Handler i have to re size them individually and then store them in different folders.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T18:29:31+00:00Added an answer on May 26, 2026 at 6:29 pm

    I’ve successfully used this method on sites before, but it’s only of use if your particular case is suitable. If you can do it using HTML and your images are the correct size on the server, then it’s probably overkill.

    If you find yourself saving several copies of the same image then you may benefit from manipulating it on the fly.

    In my scenario, using a .ashx handler enabled me to upload just one large hi-res image per subject and then transform it for use in several different ways:

    • Thumbnail
    • Cropped image
    • ‘Reflection’ effects (like it was above a shiny surface)
    • Various galleries

    Then it was just a case of calling it from a custom Image control and passing the correct parameters in.

    EDIT :
    Regarding saving the images, I can do it fine in mine as long as I force the .ashx extension that the browser tries to give it to be JPEG (or whatever).

    I can’t give you a full working .ashx example, and there are so many sub-topics you’ll need to consider:

    • Security – only read from certain locations
    • Formats – are you going to output all images in, say, JPEG, regardles of the original format?
    • HttpHandlers – how to create and use them (not just for images)
    • Graphics manipulation – familiarise yourself with the Graphics object in .NET
    • Memory streams

    As a small example (in VB.NET), here’s a simple method to resize an image given the new width and height:

    Imports System
    Imports System.Web
    Imports System.Drawing
    Imports System.Drawing.Imaging
    Imports System.IO
    Imports CustomImaging
    Imports System.Collections.Generic
    
    Public Class ImgHandler : Implements IHttpHandler
    
    
      Public Sub ProcessRequest(ByVal context As HttpContext) Implements IHttpHandler.ProcessRequest
    
        'Process the image and output it as a stream from memory
    
      End Sub
    
      Public Shared Function ResizeImage(ByVal image As System.Drawing.Image, ByVal width As Integer, ByVal height As Integer) As System.Drawing.Bitmap
            'a holder for the result
            Dim result As New Bitmap(width, height)
            'use a graphics object to draw the resized image into the bitmap
            Dim g As Graphics = Graphics.FromImage(result)
            Try
                'set the resize quality modes to high quality
                g.CompositingQuality = System.Drawing.Drawing2D.CompositingQuality.HighQuality
                g.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.HighQualityBicubic
                g.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.HighQuality
                'draw the image into the target bitmap
                g.DrawImage(image, 0, 0, result.Width, result.Height)
            Catch ex As Exception
    
            Finally 'clean up resources
                If Not g Is Nothing Then g.Dispose()
    
            End Try
            'return the resulting image
            Return result
       End Function
    
       Public ReadOnly Property IsReusable() As Boolean Implements IHttpHandler.IsReusable
            Get
                Return False
            End Get
        End Property
    
    End Class
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

When using socket in the UNIX domain, it is advisable to use path name
Is it advisable to implement url routing for an asp.net(webforms) website which is one
I use flash[:error] to display a simple message to users that they cannot do
It is advisable to use tables in HTML pages (now that we have CSS)?
Is it advisable to use arrays in Javascript using tens of thousands of indexes?
Why is it not advisable to use JavaScript in JSP? One rationale that I
I'm just learning Perl. When is it advisable to use OO Perl instead of
I've read that system(pause) is slow and not advisable to use. Is there any
I am using Telerik controls in an ASP.NET Website. It takes time while sending
Is it advisable to use Session variables to pass data between aspx pages on

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.