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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T01:51:05+00:00 2026-06-04T01:51:05+00:00

I have a bit map image that I will generate during runtime. I do

  • 0

I have a bit map image that I will generate during runtime. I do not have a local url for it as it is generated on runtime this way and returned to me. Is there a way to add this image to cshtml file or html file at runtime?

public Bitmap GetBarcodeImage(string inputString)
    {

        Bitmap bitmap = new Bitmap(200,100);

        Graphics graphics = Graphics.FromImage(bitmap);

        graphics.Clear(Color.White);

        graphics.DrawString(inputString, new Font("Free 3 of 9",60,FontStyle.Regular), Brushes.Black, new PointF(0, 0));


        return bitmap;

    }
  • 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-06-04T01:51:06+00:00Added an answer on June 4, 2026 at 1:51 am

    You could create an asp.net mvc action that returns a FileContentResult that will return the bitmap.
    Something like this:

    public FileContentResult imageGenerate(string s)
        {
            Bitmap b = getBarcodeImage(s);
            ... get byte array from bitmap ...
            return new FileContentResult(bytes, "image/bmp");
        }
    

    Then in your view of another action you would reference the image using the imageGenerate action

    <img src="<%=Url.Action("imageGenerate","SomeController", new {s = "asdf"}) %>" />  
    
    • 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 control that will have a bitmap image in it.
I have a PNG image that has an unsupported bitmap graphics context pixel format.
I have a bitmap image context and want to let this appear blurry. So
I have a simple question. I have this bitmap Is there a way with
I basically have an image of a world map and i would like to
I have a List Box hwich is modified in a such a way that
I have been asked to write a GUI that will allow objects to be
I have an object that contains: the image itself (type: {System.Drawing.Bitmap}) image type (type:
I want to upload the image using the .NET webservices and that will be
I need to write a map service that returns a single, static map image

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.