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

The Archive Base Latest Questions

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

I am re-sizing an image after a user uploads it to maintain its aspect

  • 0

I am re-sizing an image after a user uploads it to maintain its aspect ratio but be no more than 200 pixels wide or 200 pixels high.

I am then displaying the image in an ASP.Net Image control. How do I prevent the images from affecting the surrounding elements? I tried setting the Width property and Height property of the control but that just re-sizes the image itself. Is there maybe a way to wrap the control in a div with a fixed width/height?

Thanks a lot

  • 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-25T18:41:30+00:00Added an answer on May 25, 2026 at 6:41 pm

    One way is to resize the image based on aspect ratio, but leave a border in order to fill the 200×200 size. This can then be embedded in the page with the same dimensions without affecting layout.

    Alternatively you can just set the overflow property of your surrounding div to hidden, and set the div Width/Height. However it depends how to want this to look. Something like:

    <div style="overflow: hidden; width: 200px; height: 200px">
       ...
    </div>
    

    If you are actually saying you want an image sized 200px x 400px to display in full – then just set Width to 200px.

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

Sidebar

Related Questions

I have photo gallery code that does image re-sizing and thumbnail creation. I use
I've a strange problem regarding auto sizing of a panel in a user control.
I m looking for ASP.NET Image Resizing, Cropping that is good in image re-sizing,
I've made a custom spinner but the sizing isn't exactly what I want it
I'm trying to make an image editor with canvas, but I ran into some
I've got two sizing issue regarding a Window I've got. The basic layout is
I've read a lot about the pros and cons of sizing with either relative
I want to know if there are any existing benchmarks and sizing information for
I have an image in my html with a class of stretch. Currently, with
I'm currently implementing some image processing code for Android. I'm aware of the memory

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.