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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T05:02:39+00:00 2026-06-02T05:02:39+00:00

In my website I am generating a Bitmap dynamically and it needs to be

  • 0

In my website I am generating a Bitmap dynamically and it needs to be rendered according to the browsers width and height so there is no overflow on the page.

I have successfully created an image and rendered it but I do not know how to get the browsers width and height and pass it to the action for the image render

View:

@{
ViewBag.Title = "Index";
}
<h2>Home</h2>
<br />
<img src="@Url.Action("Image", new { height = , width = })" alt="image" usemap="#clickMap" height="" width="" />

Controller:

public ActionResult Image(int width, int height)
{
    MemoryStream stream = new MemoryStream();
    var image = DynamicImages.ImageGeneration.GetWorkflow(width, height);

    image.Save(stream, ImageFormat.Png);

    return File(stream.ToArray(), "image/png");
}

I have put a jQuery function in a file called Browser.js in to get the screen height but I dont have a clue how to reference this:

function getWidth() {
    return $(window).width();
}

Can anyone help?

  • 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-02T05:02:40+00:00Added an answer on June 2, 2026 at 5:02 am

    I have managed to get this working.
    Rather than adding an image element to the page and changing the source I have simply generated an image tag in a function and added that to a div in the page. as for the call to the action I hard coded the url call (which is what @Url.Action() does anyway) and this works
    Here is my code:

    @{
    ViewBag.Title = "Index";
    }
    <h2>Home</h2>
    <br />
    <script type="text/javascript">
    
        $(document).ready(function () {
            renderWorkflow();
        });
    
        function renderWorkflow() {
            var width = $(window).width();
            var height = $(window).height();
            var imageLink = "<img id=\"workflow\" src=\"/Home/WorkflowImage?width=" + width + "&height=" + height + "\" alt=\"Workflow Image\" />";
    
            $("#workflowImage").html(imageLink);
        }
    
    </script>
    <div id="workflowImage">
        <p>Java script must be enabled in order to render the workflow</p>
    </div>
    <map id="clickMap" name="clickMap">
    </map>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a website which is code generating practically everything on the page. The
I am generating a website dynamically with a couple of ColdFusion functions, they use
For my website in PHP, we are generating mobile website and have to implement
I'm dynamically generating image from text, and existing image on my asp.net website. Here
Should a highly dynamic website that is constantly generating new pages use a sitemap
I'm generating a CSV from an MVC 3 website and using a FileContentResult to
for website that embed flash to capture camera (red5..etc). may i know is there
I have an ASP.NET website from which the users themselves will generate custom reports
Iam desghning glitter text generating website ..where users can select glitters[images] to put it
I have a website that is fairly database intensive, so I'm trying to cut

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.