Recent

Author Topic: Change Screen Resolution  (Read 18454 times)

Kjooow

  • Jr. Member
  • **
  • Posts: 90
Change Screen Resolution
« on: November 04, 2009, 05:58:54 pm »
Hi,

I need to change screen resolution, but I can't find how to do this.

1) Is there a os-indipendent way?

2) how to make procedures to change it in all os supported by Lazarus? (My importance order: Win, Linux, MacOSX, WinCE, etc)

Thank you very much!

Kjooow

  • Jr. Member
  • **
  • Posts: 90
Re: Change Screen Resolution
« Reply #1 on: November 06, 2009, 12:48:30 am »
up, please :)

theo

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1933
Re: Change Screen Resolution
« Reply #2 on: November 06, 2009, 10:09:27 am »
May I ask why you want to do this?
The user can change resolution via systems settings I guess.

I doubt there is a os-indipendent way, because this is very unusual and very specific to the platform.

Kjooow

  • Jr. Member
  • **
  • Posts: 90
Re: Change Screen Resolution
« Reply #3 on: November 06, 2009, 12:59:13 pm »
May I ask why you want to do this?

I'm doing a sort of demo that works with many resolutions ;)

Quote
The user can change resolution via systems settings I guess.

Yes, but... how? :)

Quote
I doubt there is a os-indipendent way, because this is very unusual and very specific to the platform.

   
I guess, so I thought a sort of component for the os-indipendent way. But I would be happy just to know how to do it for every system supported by Lazarus... :) (Linux, Windows in first)

Bye :)

Vincent Snijders

  • Administrator
  • Hero Member
  • *
  • Posts: 2661
    • My Lazarus wiki user page
Re: Change Screen Resolution
« Reply #4 on: November 06, 2009, 01:52:00 pm »
The user can change resolution via systems settings I guess.

Yes, but... how? :)
On windows 2000: Right click on the desktop -> Properties -> Settings -> Screen Area.

Kjooow

  • Jr. Member
  • **
  • Posts: 90
Re: Change Screen Resolution
« Reply #5 on: November 06, 2009, 01:56:08 pm »
The user can change resolution via systems settings I guess.

Yes, but... how? :)
On windows 2000: Right click on the desktop -> Properties -> Settings -> Screen Area.


Ummm... I'm sorry, I mean in a Lazarus project, not manually.
Manually is not professional...

theo

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1933
Re: Change Screen Resolution
« Reply #6 on: November 06, 2009, 02:31:45 pm »
Manually is not professional...

I'd say the opposite. A non-system software that changes my screen resolution will be moved to /dev/null immediately.  :D

Anyway, I can't help you. I think it has to be done for each system separately.
« Last Edit: November 06, 2009, 02:33:16 pm by theo »

Kjooow

  • Jr. Member
  • **
  • Posts: 90
Re: Change Screen Resolution
« Reply #7 on: November 06, 2009, 02:46:43 pm »
I'd say the opposite. A non-system software that changes my screen resolution will be moved to /dev/null immediately.  :D

Well, you will never use my program ;)

For example... do you have never played with a fullscreen game? Generally these programs change your screen resolution to obtain better system performance.

So... the question isn't what will do my program, but how can I do to make it working.
There are a lot of things that a program is designed for and maybe a lot of these aren't for you.

Al last,
if "you have the knowledge to answer me" then "please, reply in this thread"
else "please, don't reply" AND "don't make garbage here"

Thank you.

Vincent Snijders

  • Administrator
  • Hero Member
  • *
  • Posts: 2661
    • My Lazarus wiki user page
Re: Change Screen Resolution
« Reply #8 on: November 06, 2009, 02:53:06 pm »
Al last,
if "you have the knowledge to answer me" then "please, reply in this thread"
else "please, don't reply" AND "don't make garbage here".
You ask at least the undesirable and maybe the impossible. That is why nobody answered to your first post in this thread. Your second post made me think you wanted an answer, even if it was a no, it is not possible.

EMTR

  • New Member
  • *
  • Posts: 20
Re: Change Screen Resolution
« Reply #9 on: November 06, 2009, 03:27:25 pm »
This help?

http://www.latiumsoftware.com/en/delphi/00031.php

I imagine in Windows there's an API you can use to get at all these settings - maybe check MSDN and call the appropriate API in windows? Makes it windows specific though... In Linux I'm sure theres a similar API but who uses Linux anyway? lol...

Kjooow

  • Jr. Member
  • **
  • Posts: 90
Re: Change Screen Resolution
« Reply #10 on: November 06, 2009, 03:37:12 pm »
Al last,
if "you have the knowledge to answer me" then "please, reply in this thread"
else "please, don't reply" AND "don't make garbage here".
You ask at least the undesirable and maybe the impossible. That is why nobody answered to your first post in this thread. Your second post made me think you wanted an answer, even if it was a no, it is not possible.

This part of my post that you quote is referred only to theo. I'm sorry for misunderstood.

In original post I asked 2 question:

- the first was simply a curiosity if there is a way (read component) to do this in os-indipendent way (like a series of ifdef for each os): there isn't.

- in the second I asked in wich way we can change screen resolution, like many other languages/programs already do.
For example in c# it is possible, in VB also, even seem possible in Java, in delphi also possible (so I think I can use this in Lazarus for Windows), but in Lazarus for Linux or MacOSX... nobody knows.

Ok, I understand that in FPC/Lazarus is not possible :(
(I'll try with Delphi method, but my program will be multi-platform, so all os will have the same functions)

Thanks

Kjooow

  • Jr. Member
  • **
  • Posts: 90
Re: Change Screen Resolution
« Reply #11 on: November 06, 2009, 03:47:04 pm »
This help?

http://www.latiumsoftware.com/en/delphi/00031.php

I imagine in Windows there's an API you can use to get at all these settings - maybe check MSDN and call the appropriate API in windows? Makes it windows specific though... In Linux I'm sure theres a similar API but who uses Linux anyway? lol...

Thanks for reply, The problem is exactly this. As I just wrote, my program will be multi-platform, so all os will have the same functions... I need to change res in more os, not only on Windows.

However maybe I found a trick to do in Linux... but it's only a "trick" (not professional) and I think it need root privileges:

To change resolution size: xrandr -s 1024x768
And to check the size and mode available: xrandr -q

EMTR

  • New Member
  • *
  • Posts: 20
Re: Change Screen Resolution
« Reply #12 on: November 06, 2009, 03:52:08 pm »
Fair play - I'm not sure what the linux system calls are - who honestly uses linux? Without starting a flame war... That's a throw away comment - most people use Windows - even Mac has a larger share of the market as opposed to linux....

Still if your trying to use Linux check out ranr or dga on the internet - I'm not sure what these require, if there are limitations etc.

Troodon

  • Sr. Member
  • ****
  • Posts: 484
Re: Change Screen Resolution
« Reply #13 on: November 06, 2009, 04:08:37 pm »
I need to change screen resolution, but I can't find how to do this.
1) Is there a os-indipendent way?
2) how to make procedures to change it in all os supported by Lazarus? (My importance order: Win, Linux, MacOSX, WinCE, etc)

I can imagine you want to develop a game (as in, full-screen application) and you would like to set the screen resolution programatically. That is very likely OS-dependent and, on platforms such as Linux, it may also depend on the graphics system (e.g., X Window) and window manager. Anyway, you may wish to have a look here and here.
« Last Edit: November 06, 2009, 04:11:19 pm by Troodon »
Lazarus/FPC on Linux

Kjooow

  • Jr. Member
  • **
  • Posts: 90
Re: Change Screen Resolution
« Reply #14 on: November 06, 2009, 04:49:43 pm »
I already made a fullscreen function os- indipendent, and it works well and simply (4/5 rows of code).
What I need at moment, is only to change the screen resolution.

Thank you EMTR for suggestion to search ranr or dga.
Thank you Troodon for links, I'll read these (principally the first).

 

TinyPortal © 2005-2018