• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 422
  • Last Modified:

C# image control

I am using image control in winforms C#.

I have varying size of images which exceed the control size i have set. Both horizontally as well as vertically.

Can any of you help me with code which can resize the image in runtime to fit the image control
  • 2
1 Solution
Carl TawnSystems and Integration DeveloperCommented:
If you mean a PictureBox control then you can set the SizeMode property to Zoom which will then size the image to match the control.
GRChandrashekarAuthor Commented:
Yes picture box. SizeMode does not work is pic is bigger than control size
Carl TawnSystems and Integration DeveloperCommented:
That shouldn't matter. Setting the SizeMode property to Stretch (rather than Zoom in my last post) will scale the image down to match the size of the PictureBox.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now