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

Picture box that looks the same on any screen

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
meravkn
Asked:
meravkn
1 Solution
 
DreamMasterCommented:
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
 
TimCotteeCommented:
0
 
rspahitzCommented:
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
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
mcoopCommented:
0
 
inthedarkCommented:

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
 
inthedarkCommented:
actualheight=14.5
0
 
rspahitzCommented:
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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

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