473,396 Members | 1,767 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

All I'm looking for is a simple answer to a simple question

I originally asked this question in the "classic" VB forum. It occured to me
after I had sent it that I sent it to the wrong forum.

Anyway!

Here's the situation. I have VB.NET 2005 Express Edition. I have a 19" LCD
monitor with the resolution set at 1280 by 1024. I want to create a graphics
program, say, displaying fractals that will run with the form maximized. Are
the XY coordinates on the form independent of the size & resolution of the
monitor? I posted a question in this same newsgroup, & the person stated
that it's necessary in the code to determine the resolution of the monitor. Is
that really necessary? How do I do that? I don't want to have to create a
program for each & every monitor size & resolution! I would think that it
doesn't matter what size or resolution a monitor has. So, bottom line - my
monitor is set at 1280 by 1024. If someone with a 17" CRT monitor with a
resolution of 800 by 600 installs the program, will there be a problem? Thank
you.

I got 2 replies in the "Classic" VB forum.

Here is the first:
But... The X and Y coordinates won't change, just the amount of screen space
available (height and width). A pixel is a pixel regardless of how many
inches you have. You'll have to interrogate the Graphics object at run time
to see how much space you have to draw on.

Here is the second:
The resolution is the only thing that matters; the monitor size does
not. Things will work the same on a 15" monitor at 1024x768 as they
will on a 21" monitor at 1024x768.

So, you can see my confusion! How do I interrogate the Graphics object? Why
do I have to interrogate the Graphics object? Do I have to code the program
for a specific resolution? Which is the correct answer - the first reply or
the second?

Things were so much simpler in "classic" VB!

Thank you.

David

Jun 7 '06 #1
4 1414
Actually a lot of things are much easier in dotnet.

The point I believe that needs to be made is that 0,0 will always be in
the top left corner of your screen. If you have an 800x800 res, than a
graphic (fractal) that is centered by using the origin of the screen
(0,0) and adding x and y values may not be centered on a larger
resolution. Think of resolutions as boxes that start at 0,0 and extend
x and y amount of pixels.

As for vb.net here is the code to get the screen res

http://groups.google.com/group/micro...af73f64eaf4382

Now if you create a windows form application and set the form to
maximize and your fractal is centered on the form it will not matter
which resolution you use.

pcnerd wrote:
I originally asked this question in the "classic" VB forum. It occured to me
after I had sent it that I sent it to the wrong forum.

Anyway!

Here's the situation. I have VB.NET 2005 Express Edition. I have a 19" LCD
monitor with the resolution set at 1280 by 1024. I want to create a graphics
program, say, displaying fractals that will run with the form maximized. Are
the XY coordinates on the form independent of the size & resolution of the
monitor? I posted a question in this same newsgroup, & the person stated
that it's necessary in the code to determine the resolution of the monitor. Is
that really necessary? How do I do that? I don't want to have to create a
program for each & every monitor size & resolution! I would think that it
doesn't matter what size or resolution a monitor has. So, bottom line - my
monitor is set at 1280 by 1024. If someone with a 17" CRT monitor with a
resolution of 800 by 600 installs the program, will there be a problem? Thank
you.

I got 2 replies in the "Classic" VB forum.

Here is the first:
But... The X and Y coordinates won't change, just the amount of screen space
available (height and width). A pixel is a pixel regardless of how many
inches you have. You'll have to interrogate the Graphics object at run time
to see how much space you have to draw on.

Here is the second:
The resolution is the only thing that matters; the monitor size does
not. Things will work the same on a 15" monitor at 1024x768 as they
will on a 21" monitor at 1024x768.

So, you can see my confusion! How do I interrogate the Graphics object? Why
do I have to interrogate the Graphics object? Do I have to code the program
for a specific resolution? Which is the correct answer - the first reply or
the second?

Things were so much simpler in "classic" VB!

Thank you.

David


Jun 7 '06 #2
On Wed, 7 Jun 2006 07:47:02 -0700, pcnerd
<pc****@discussions.microsoft.com> wrote:
I originally asked this question in the "classic" VB forum. It occured to me
after I had sent it that I sent it to the wrong forum.

Anyway!

Here's the situation. I have VB.NET 2005 Express Edition. I have a 19" LCD
monitor with the resolution set at 1280 by 1024. I want to create a graphics
program, say, displaying fractals that will run with the form maximized. Are
the XY coordinates on the form independent of the size & resolution of the
monitor? I posted a question in this same newsgroup, & the person stated
that it's necessary in the code to determine the resolution of the monitor. Is
that really necessary? How do I do that? I don't want to have to create a
program for each & every monitor size & resolution! I would think that it
doesn't matter what size or resolution a monitor has. So, bottom line - my
monitor is set at 1280 by 1024. If someone with a 17" CRT monitor with a
resolution of 800 by 600 installs the program, will there be a problem? Thank
you.

I got 2 replies in the "Classic" VB forum.

Here is the first:
But... The X and Y coordinates won't change, just the amount of screen space
available (height and width). A pixel is a pixel regardless of how many
inches you have. You'll have to interrogate the Graphics object at run time
to see how much space you have to draw on.

Here is the second:
The resolution is the only thing that matters; the monitor size does
not. Things will work the same on a 15" monitor at 1024x768 as they
will on a 21" monitor at 1024x768.

So, you can see my confusion! How do I interrogate the Graphics object? Why
do I have to interrogate the Graphics object? Do I have to code the program
for a specific resolution? Which is the correct answer - the first reply or
the second?

Things were so much simpler in "classic" VB!


This generic question and the answer are the same in any programming
envionment.

Assume a given form that contains an 800 x 600 image in a picture box.
In any size of monitor that is set at 1280 x 1024, the displayed form
will be the same. In any size monitor that is set to 800 x 600, a
portion ot the right and bottom of the picture will not be visible
unless form scrolling has been implemented.

Assume the above, but with the picture in a scrollable child form. If
the main form's layout was designed to accomodate 800 x 600, then the
user's resolution setting is a non-issue.

A common practice is to design an app around a minimum supported
screen resolution meaning if 1024 x 768 is to be the minimum supported
size, then the app will not run on an 800 x 600 system.
Gene
Jun 7 '06 #3
One easy way to draw your fractals on any screen resolution is to pick a
nominal resolution then in all drawing routines where you input x,y, use
fx(nominalxvalue) and fy(nominalyvalue). In you functions fx and fy, you can
convert the nominalxvalue and nominalyvalue to the proper x,y values
depending on the screen resolution that is currently running. Hope this
helps.
--
Dennis in Houston
"pcnerd" wrote:
I originally asked this question in the "classic" VB forum. It occured to me
after I had sent it that I sent it to the wrong forum.

Anyway!

Here's the situation. I have VB.NET 2005 Express Edition. I have a 19" LCD
monitor with the resolution set at 1280 by 1024. I want to create a graphics
program, say, displaying fractals that will run with the form maximized. Are
the XY coordinates on the form independent of the size & resolution of the
monitor? I posted a question in this same newsgroup, & the person stated
that it's necessary in the code to determine the resolution of the monitor. Is
that really necessary? How do I do that? I don't want to have to create a
program for each & every monitor size & resolution! I would think that it
doesn't matter what size or resolution a monitor has. So, bottom line - my
monitor is set at 1280 by 1024. If someone with a 17" CRT monitor with a
resolution of 800 by 600 installs the program, will there be a problem? Thank
you.

I got 2 replies in the "Classic" VB forum.

Here is the first:
But... The X and Y coordinates won't change, just the amount of screen space
available (height and width). A pixel is a pixel regardless of how many
inches you have. You'll have to interrogate the Graphics object at run time
to see how much space you have to draw on.

Here is the second:
The resolution is the only thing that matters; the monitor size does
not. Things will work the same on a 15" monitor at 1024x768 as they
will on a 21" monitor at 1024x768.

So, you can see my confusion! How do I interrogate the Graphics object? Why
do I have to interrogate the Graphics object? Do I have to code the program
for a specific resolution? Which is the correct answer - the first reply or
the second?

Things were so much simpler in "classic" VB!

Thank you.

David

Jun 8 '06 #4

pcnerd wrote:
I originally asked this question in the "classic" VB forum. It occured to me
after I had sent it that I sent it to the wrong forum.

Anyway!

Here's the situation. I have VB.NET 2005 Express Edition. I have a 19" LCD
monitor with the resolution set at 1280 by 1024. I want to create a graphics
program, say, displaying fractals that will run with the form maximized. Are
the XY coordinates on the form independent of the size & resolution of the
monitor? I posted a question in this same newsgroup, & the person stated
that it's necessary in the code to determine the resolution of the monitor. Is
that really necessary?
Well, different screen resolutions mean different numbers of pixels,
so, yes. Note there is a difference between the monitor and the screen
- the monitor is the physical object, the screen is what programs draw
on. A *monitor* doesn't really have a resolution (LCD monitors have a
'native resolution' but that doesn't mean the screen they display has
to have that resolution).
How do I do that? I don't want to have to create a
program for each & every monitor size & resolution! I would think that it
doesn't matter what size or resolution a monitor has. So, bottom line - my
monitor is set at 1280 by 1024. If someone with a 17" CRT monitor with a
resolution of 800 by 600 installs the program, will there be a problem? Thank
you.
What happens if you draw a 1000 pixel x 1000 pixel box on a 1280x1024
screen? On a 800x600 screen? Different results, right? That's why it
matters.

I got 2 replies in the "Classic" VB forum.

Here is the first:
But... The X and Y coordinates won't change, just the amount of screen space
available (height and width). A pixel is a pixel regardless of how many
inches you have. You'll have to interrogate the Graphics object at run time
to see how much space you have to draw on.
Right idea, wrong object.

Here is the second:
The resolution is the only thing that matters; the monitor size does
not. Things will work the same on a 15" monitor at 1024x768 as they
will on a 21" monitor at 1024x768.
True but misleading (although your question wasn't the clearest)
So, you can see my confusion! How do I interrogate the Graphics object? Why
do I have to interrogate the Graphics object? Do I have to code the program
for a specific resolution? Which is the correct answer - the first reply or
the second?
You havae to find out what the current screen resolution is. You can't
just say "I want to draw a box as big as the screen" - you have to say
how many *pixels* big you want your box to be.

It's in fact really simple to find out the resolution of the screen:

Dim screenRect As Rectangle = Screen.PrimaryScreen.Bounds
Things were so much simpler in "classic" VB!


How would things have been different in vb6? You can't magically say
'as big as the screen' there either - you would have to interrogate
Screen.Height and Screen.Width, *and* convert from twips to pixels.

--
Larry Lard
Replies to group please

Jun 8 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Beach Potato | last post by:
Hi: I've searched newsgroups and various archives, including MSDN & MFC sources, but at this point failed to locate an accurate and simple implementation of WndProc function for MSWindows window...
14
by: Matt | last post by:
Any progammers looking for a killer app to develop? How about a voice enabled forum? One of the most powerful, exciting, and engrossing experiences on the Internet is the Forum. The first great...
16
by: Squid Seven | last post by:
can somebody suggest a good newsgroup to ask questions specific to dealing with the windowing api in c++ - seems like it would be a little off-topic in this forum, but I can't find a decent...
10
by: Teis Draiby | last post by:
In an application manipulating streaming video and 3D stuff I want to implement mutithreading to ensure a decent UI response time. Since my application is very speed critical I want to use the...
24
by: Kevin | last post by:
Hey guys. I'm looking to get together some VB programmers on Yahoo messenger. I sit at a computer and program all day. I have about 3 or 4 people already, but it would be really cool to have a...
11
by: admin | last post by:
Hi all, First time poster here... I'm a webmaster and I'd like to add a simple script to my website which will allow users to fill in a brief multiple choice questionaire, and then provide a...
1
by: Dan | last post by:
Folks -- First - as this may be a FAQ question, I apologize for being off topic and needlessly recycling a question. I have not found an answer to this yet. What I am looking for: On of...
6
by: beantaxi | last post by:
Hello all, I'm looking for a very simple code analysis tool. I have a large codebase to analyze, and all I really need to do is to find all uses of all methods in a few interfaces. Many tools...
17
by: Chris M. Thomasson | last post by:
I use the following technique in all of my C++ projects; here is the example code with error checking omitted for brevity: _________________________________________________________________ /*...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.