Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 151
  • Last Modified:

Picture H x W not to exceed certain size ........

I want to display jpeg's of various sizes in either an image or picture box but I don't want the width to exceed 5625 twips or the height to exceed 7185 twips. (I would like to reduce pictures larger then these measurements to fit within these specs and maintain the hxw ratio to avoid distortion) It would be desireable to expand the picture (if smaller) to fit this window, but not neccessary (again maintaining ratio). I don't want to use scroll bars.
I have tried paintpicture meathod but don't know how to reduce and maintain ratio. Please provide code examples.
(I am not really a programmer!!!)
Thanks
0
jclarkmcse
Asked:
jclarkmcse
  • 3
  • 3
1 Solution
 
kamallCommented:
Use an image box. Set its height and width properties to those you specified and set its strech property to true.
All images that will be loaded into the image box will be streched to the size of the box.
Regards.
0
 
GivenRandyCommented:
0
 
kamallCommented:
Note that this is only possible with the image box, not the picture box because the last does not have a strech property.
0
Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

 
GivenRandyCommented:
kamall, your suggestion distorts the picture.  Did you try it?
0
 
jclarkmcseAuthor Commented:
Easy points for you, but worth it for me!!  Thanks!
0
 
GivenRandyCommented:
Hmmm.  Did you try it jclarkmcse?  I did, but it distorted the picture.
0
 
kamallCommented:
Thanks jclarkmcse for both the points and the grade, and you are welcome.

GivenRandy,
Any picture will be distorted if its dimentions are not somewhat close to the dimentions of the image box, regardless of the way (the technique) you use to display it. In fact, the distortion increases proportionally to the difference between the dimensions of the image box and the actual picture.

Regards to all.
0
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: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

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

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