?
Solved

Picture box that looks the same on any screen

Posted on 2001-08-13
7
Medium Priority
?
171 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 4

Expert Comment

by:mcoop
ID: 6382044
0
 
LVL 17

Accepted Solution

by:
inthedark earned 200 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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
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 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…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Suggested Courses
Course of the Month11 days, 11 hours left to enroll

752 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