|
-
Jul 26th, 2000, 09:23 PM
#1
Thread Starter
Fanatic Member
Okay, my program's coming along nicely and maybe you've even noticed that I have cut back a bit on the torrent of questions that I had been asking as I am trying to figure out a bit more of this on my own . . .
I do need to make sure that I'm about to embark on my latest tweak to my program in the right way. I want to be able to keep the perspective of my command buttons and text boxes and check boxes the same no matter what the resolution, as opposed to having the stuff all creep up into the upper left corner as the screen resolution increases.
In theory I'm thinking that what I need to do is get the screen looking the way I want it at one particular resolution, and then figure out the ratios of the size and position of every single object to that resolution. Then I'll have to have a routine in the code to get the user's current resolution and scale all the objects accordingly.
This seems like it would be the most straightforward way to do this, but is it the easiest, and is it even feasible?
As far as the size of the text in relation to the resolution, the program is not really like Word or a web browser in that a user might want to go to a higher resolution in order to get more real estate at the expense of smaller text. I wouldn't mind at all if I could keep the letters the same size no matter what the resolution, but it seems that there are only a few limited choices for font sizes in the text boxes. Is there any hope for keeping the size of the text somewhat consistent?
with much love for my brothers in code,
-
Jul 26th, 2000, 11:59 PM
#2
Hyperactive Member
Just out of curiosity what do you get when you type the following into the Immediate window?
Code:
? Screen.TwipsPerPixelX
"Supposedly" this is to let you know how many "Twips" represent a single pixel based on a combination of factors including your resolution and Monitor size....
But I have only ever seen this return "15" myself personally
-
Jul 27th, 2000, 12:29 AM
#3
Thread Starter
Fanatic Member
-
Jul 27th, 2000, 01:14 AM
#4
Frenzied Member
15 Twips per Pixel
I get 15 Twips per Pixel at all resolutions from 640 X 480 to 1200 X 1024 (That is all that is possible on my 15 inch monitor). I am not sure what would happen on larger monitors. Also, I wonder if this varies with dot pitch.
Somebody who answered other Posts correctly claimed that a Twip was an absolute quantity like an inch, point, or meter. That Post led me astray for a while.
Pixel size certainly seems to vary with resolution, so it seems as though a Twip also varies with resolution.
I have written some applications which plot points in 3D perspective. My results are pretty much what I wanted, but I got those results by experimenting. I still do not understand ScaleMode for Picture Boxes. When I set ScaleMode to centimeters (or inches or points) and draw a line 10 units long, the measured length on my monitor varies with Screen Resolution.
Perhaps a line "2 inches" long (or a 12-Point Font) would print 2 inches long (or as 12-points), even though the size on the screen varies with Screen Resolution.
I have not found a good explanation for the above in my MSDN library (I have the latest version). If anybody knows what the story is or where to read about it, I would like to know.
Live long & prosper.
The Dinosaur from prehistoric era prior to computers.
Eschew obfuscation!
If a billion people believe a foolish idea, it is still a foolish idea!
VB.net 2010 Express
64Bit & 32Bit Windows 7 & Windows XP. I run 4 operating systems on a single PC.
-
Aug 16th, 2001, 08:51 PM
#5
Member
Let's get some things clear...
Guys,
You are getting way ahead of yourselves. VB does indeed give you all the resources that you should need in order to perform what you need to perform. You'll probably need to write a bit of code, however it certainly is possible.
Here's what you guys do:
Create the following Function(s):
CaptureDimensions() - Will loop through all controls on your form, it will only ever be run once you have got your GUI correct on your Design Machine. It will need to capture the Screen Size (Height & Width) it will then need to Capture the Sizes of your Form (H&W) as well as the Scale H&W of your form, then for each control, listen carefully here; Copy the Dimensions (ie. Top, Left, Height & Width as well as FontHeight & FontWidth) of your Controls and store this information as a PERCENTAGE (%) of the total Forms SCALE_SIZE(H&W).
Now when it comes to run-time, start with the Form (as a % of the Total Screen Size), then work your way down to the Controls (sizes first) and then worry about the Text (FontHeight & Width).
This should now allow you to compensate for any DAMNED thing the User decides to throw at you, whether they have their system set to Large_Fonts, Small_Fonts, or whether their screen size is 1600x1200 or whether it is 640x480, even if you have to set the Font size to 2points (extremely hard to read), however they chose that screen resolution, we (as the Programmers), are only there to make sure our Programs are the most dynamic & flexible they can possibly be.
Points of Note: Always Use the same scale mode - Pixels or twips work best, and only store the information as a percentage of the overall mass. (ie. the form_size as a % of the Screen Size, the control size & position as a % of the form_size, & the text_size as a % of the form_size).
Follow this formula and your program's GUI's should be just about BEAN proof (Mr. Bean, that is). And yes, although this will take quite a long time to resize everyting everytime they resize the form, DON't ALLOW THEM THE OPTION TO RESIZE THE FORM! - If we can deliver it perfect, it should be PERFECT!
And what about the long time at loadup?, well either display another form with a progress bar, or an animated GIF, but if your not willing to put in the effort to make it work, stop whingeing that it doesn't! - Grow some hair on your VB.Chest, pull out your VB.Finger & see what you can come up with.
Last edited by T-Bone; Aug 16th, 2001 at 08:56 PM.
Diplomacy is being able to tell someone to go to hell in such a way, that they actually look forward to the trip.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|