Solved

Picture box that looks the same on any screen

Posted on 2001-08-13
7
163 Views
Last Modified: 2010-05-02
Hi,

I have a picture box that should be exactly 3.5" * 3.625 "
If I write the matching width and height in twips (5040*5220), what I see on the screen is MUCH larger than how it suppose to look like. Why does it happen? what should I do to force the screen to show the picture box in the "right" size? and how do I make sure that it will look the same on any monitor???

Thanks a lot!
0
Comment
Question by:meravkn
7 Comments
 
LVL 19

Expert Comment

by:DreamMaster
ID: 6380507
Making sure that it will look the same on all monitors is really hard...but using twips surely won't help....normally I use pixels that gives reasonably accurate measures..

Max.
0
 
LVL 43

Expert Comment

by:TimCottee
ID: 6380676
0
 
LVL 22

Expert Comment

by:rspahitz
ID: 6381092
I argue that it's impossible to auto-sense how big a control should be to create a predetemined size.

Because...although you MAY be able to detect a screen resolution. That's only part of the issue.

Aside from screen resolution, you have monitor sizes that differ in how much viewable area they have, and ...

Projector are really monitors and can accept output from your PC as though they are just monitors, and can be projected onto any surface at any distance.

How can you force a projector to display a window that's 3.5" on a wall that's 30 feet away?  Would you really want that?

--
Your best bet is to still use relative sizes for viewing purposes.  If you want to PRINT 3.5" that can usually be controlled because of the pritn parameters, but screen displays are never controlled to the point where you can detect every variation.
0
What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

 
LVL 4

Expert Comment

by:mcoop
ID: 6382044
0
 
LVL 17

Accepted Solution

by:
inthedark earned 50 total points
ID: 6382646

If it is absolutely essential to have an object an exact physical size it can be done but not via software alone.

You have to use a calibration technique:

Step 1 display an object say six inches square. e.g. twips = 1440 * 6
(If you are happy with cm use a square of 15cm square e.g. 567*15

Step 2 measure the square using ruler and calculate the expansion/reduction  factor required to bring the image to the correct size.

Example calculation for a 15 cm square which was measured to be 15.5 cm wide and 14.5 cm heigh

intendedwidth=15
actualwidth=15.5
xfactor=(intendedwidth-(actualwidth-intendedwidth))/intendedwidth

also do the same for the height

intendedheight=15
actualheight=15.5
yfactor=(intendedheight-(actualheight-intendedheight))/intendedheight


Step 3 change your program so that whenever you set a height you multiply be the relevant factor.

e.g.

picture1.left=requiredleft*xfactor
picture1.width=requiredwidth*xfactor
picture1.height=requiredheight*yfactor
picture1.top=requiredtop*yfactor

If you are using any graphics methods you must also apply the factors to any coordinates.

If you are printing you need to apply sfactor, the smallest of either  xfactor or yfactor, to the font size.

example:

picture1.font.size=requiredsize*sfactor

Note: any graphics may be squishes or stretched a little.
p.s. avoid  3d picture boxes - make them flat

e.g. picture1.borderstyle=0
0
 
LVL 17

Expert Comment

by:inthedark
ID: 6382652
actualheight=14.5
0
 
LVL 22

Expert Comment

by:rspahitz
ID: 6384945
inthedark is correct, but even further...

To guarantee that something will be the exact size you want, you have to be in control of all aspects of the hardware.  You need to ensure that:

* it is not a projector (or if it is, it can detect the distance of the projection so you can calculate sizes);
* the monitor settings do not change (or if, for example, the horizontal size is changed, you can detect this and adjust the image size accordingly)
* the resolution doesn't change (or if it does, recalculate--this is easy because you get this from Windows)
* the monitor does not get replaced with a different model which prevents you from doing any of the above.

In other words, unless there's a really good reason to enforce a certain size, it's not going to be guaranteed because there are too many conditions out of the software's control.
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

743 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now