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 7544287
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T08:38:15+00:00 2026-05-30T08:38:15+00:00

I have created a custom server control and trying to add an image using

  • 0

I have created a custom server control and trying to add an image using System.Web.UI.WebControls.Image. I would like to use an image from memory stream or bitmap. How can I do this, it seems the WebControls.Image requires ImageURL.

I don’t have a static image, the image is created on the fly. Thanks.

  • 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-30T08:38:16+00:00Added an answer on May 30, 2026 at 8:38 am

    There’s two options here:

    1. Serve the image on a secondary request
    2. Encode the image into the page

    The first option is the most common method and highly recommended if your image is more than a few kilobytes in size. You’d implement a HttpHandler that streams back the generated image. In your page set the ImageUrl in the page to a url pointing to your handler. You could include data in the image url to instruct the handler on how to render the image or what data to use.

    You should realize though that anyone can call this handler so if your images contain sensitive or personal information, make sure you check if the request is authorized.

    The second option is to encode the image as base64 data directly into your page. Since base64 encoding blows up the data size by 137% it’s suitable for small images only. You’ll also get no support at all from the standard server controls so I you’ll have to implement this from scratch.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have created a custom server control, deriving from System.Web.Contols.CheckBoxList to customize how a
Hopefully an easy one, I have created a Custom Repeater control that extends System.Web.UI.WebControls.Repeater.
I have a my own custom web server control. I created separate CSS file
I have created a custom server control with properties implementing the ITemplate interface. It
I have created a custom Server control that processes some data, stores that data
I have created a web custom control and used within an aspx page. I
I have created a custom server control. So far this control renders some html
I have created a custom server control that inherits from CompositeControl. In the CreateChildControls
I have a custom server control (composite control having dynamically created dropdown boxes and
I have created a custom control which uploaded files to the server . These

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.