Solved

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

Posted on 2000-05-17
7
141 Views
Last Modified: 2010-05-02
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
Comment
Question by:jclarkmcse
  • 3
  • 3
7 Comments
 
LVL 7

Accepted Solution

by:
kamall earned 320 total points
ID: 2819685
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
 
LVL 9

Expert Comment

by:GivenRandy
ID: 2819687
0
 
LVL 7

Expert Comment

by:kamall
ID: 2819688
Note that this is only possible with the image box, not the picture box because the last does not have a strech property.
0
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.

 
LVL 9

Expert Comment

by:GivenRandy
ID: 2819694
kamall, your suggestion distorts the picture.  Did you try it?
0
 

Author Comment

by:jclarkmcse
ID: 2819728
Easy points for you, but worth it for me!!  Thanks!
0
 
LVL 9

Expert Comment

by:GivenRandy
ID: 2819746
Hmmm.  Did you try it jclarkmcse?  I did, but it distorted the picture.
0
 
LVL 7

Expert Comment

by:kamall
ID: 2823656
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

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.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
using Access 8 76
Best way to parse out a json string in VB6? 10 228
How does CurrentUser work? 10 39
how to loop through and process two columns in excel 8 26
Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

820 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question