473,747 Members | 2,849 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1434
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****@discuss ions.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(nominalxvalu e) and fy(nominalyvalu e). 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.PrimaryS creen.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
6633
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 objects. Something like: class BaseWindow { virtual LRESULT WndProc( HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam);
14
3167
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 Internet forums were the Usenet newsgroups. Usenet is still a powerful force, but many different types of forums are also very popular (such as message boards like Vbulliten and XMBforum). I love forums. Love em love em love em. My web site...
16
1231
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 alternative.
10
1975
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 most efficient synchronization of the shared data objects. What would that be in this case? I think there's a very simple answer to this, but I am somewhat confused by the different methods available. The data I need to transfer between threads...
24
1713
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 much larger list of people (for all of us to benefit). I have found it to be an invaluable resource to answer those hard or weird programming questions that come up. If you are interested, please reply, or send me an email at imgroup@gmail.com
11
3320
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 'thoughful' suggestion based on their answers. In terms of the logic involved with the actual script: I've mulled it over and thoroughly broken my brain, trying to devise a complicated 'scoring system' (with different answers giving different...
1
1226
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 my apps is a simple cookbook. I have recipies and stuff, and some of the recipie headers have category and type fields. However, I would like to arrange them a bit like a file system, so I would have
6
2326
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 (e.g. Resharper) obviously do this internally, but I can't seem to find any that expose this simple functionality. Command line would be fine -- in fact I'd prefer that but its not necessary.
17
5815
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: _________________________________________________________________ /* Simple Thread Object ______________________________________________________________*/ #include <pthread.h> extern "C" void* thread_entry(void*);
0
8979
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9354
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9307
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9223
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6790
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6067
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4588
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
2771
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2203
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.