C# .NET - What is mean by resolution 1024 x 768 pixels in windows application?

Asked By Eswaran Radhakrishnan on 20-Sep-08 04:55 AM
Hi all,

I was asked by somebody to set screen resoultion 1024 x 768 pixels. But I was failure to understand exactly what they need. I think they are talking about the screen width and height. But I don't know that my thinking is correct. 

So, anyone can help me to understand what is that..

>> What is mean resolution?

>> How to set resolution 1024 x 768 pixels in my windows screen?

>> When do we set the resoultion?(I mean when we design the form meanwhile should we create resolution otherwise should we set resolutions for screen after the screens designed)
>> what is the advantage of that?

Thanks
R. Eswaran.

Code Snippet for setting screen resolution 1024x768 - Kalit Sikka replied to Eswaran Radhakrishnan on 20-Sep-08 05:08 AM

private void Form1_Load(object sender, EventArgs e)

{

this.Width = 768;

this.Height = 1024;

}

your application screens should best fit in 1024 X 768 Resolution screens...

Vasanthakumar D replied to Eswaran Radhakrishnan on 20-Sep-08 05:19 AM

Hi,

it means....

your application screens should best fit in 1024 X 768 or higher Resolution screens...

resolution - Sagar P replied to Eswaran Radhakrishnan on 20-Sep-08 05:23 AM

The screen resolution signifies the number of dots (http://www.webopedia.com/TERM/r/pixel.html) on the entire http://www.webopedia.com/TERM/r/display_screen.html. For example, a 640-by-480 pixel screen is capable of displaying 640 distinct dots on each of 480 lines, or about 300,000 pixels. This translates into different dpi measurements depending on the size of the screen. For example, a 15-inch http://www.webopedia.com/TERM/r/VGA.html monitor (640x480) displays about 50 dots per inch.

See this code to set resolution;

Page_Load Code

Screen Srn = Screen.PrimaryScreen;

tempHeight = Srn.Bounds.Width;

tempWidth = Srn.Bounds.Height;

Page.ClientScript.RegisterStartupScript(this.GetType(), "Error", "<script type=\"text/javascript\">alert('" + "Your Current Resolution  is = " + tempHeight + " * " + tempWidth + "');</script>");

//if you want Automatically Change res.at page load. please uncomment this code.

 

if (tempHeight == 600)//if the system is 800*600 Res.then change to

{

FixHeight = 768;

FixWidth = 1024;

Resolution.CResolution ChangeRes = new Resolution.CResolution(FixHeight, FixWidth);

} 

Change Resoultion 

switch (cboRes.SelectedValue.ToString())

{

    case "800*600":

        FixHeight = 800;

        FixWidth = 600;

        Resolution.CResolution ChangeRes600 = new Resolution.CResolution(FixHeight, FixWidth);

        break;

 

    case "1024*768":

        FixHeight = 1024;

        FixWidth = 768;

        Resolution.CResolution ChangeRes768 = new Resolution.CResolution(FixHeight, FixWidth);

        break;

    case "1280*1024":

        FixHeight = 1280;

        FixWidth = 1024;

        Resolution.CResolution ChangeRes1024 = new Resolution.CResolution(FixHeight, FixWidth);

        break;

}