?
Solved

resolution problem

Posted on 2002-04-06
5
Medium Priority
?
251 Views
Last Modified: 2010-04-04
I do have an application with a large image interface,
and it is distorted ( becomes too large)  when runs in a lower screen-resolution,
any one, or a component  can maintain it ????? ,



RegaRdS.


anaS.
0
Comment
Question by:anas_madani
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 
LVL 3

Accepted Solution

by:
tongalite earned 400 total points
ID: 6923555
Hi,

You could check to see which screen res the user has set up and then change it to suit your design screen res mode. Change the scrn res back when your program is exited. A slight problem with this method is that sometimes the icon layout can become disarranged.
Hope this helps
tongalite.

To check/change & restore scrn res do this:
******************************************
unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  StdCtrls, ExtCtrls;

type
  TForm1 = class(TForm)
    Button1: TButton;
    Button2: TButton;
    Label1: TLabel;
    Label2: TLabel;
    procedure Button1Click(Sender: TObject);
    procedure Button2Click(Sender: TObject);
    procedure FormCloseQuery(Sender: TObject; var CanClose: Boolean);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

  implementation

{$R *.DFM}


 function SetScreenResolution( Width, Height: integer): longint;
var
 DeviceMode: TDeviceMode;
begin
 with DeviceMode do begin
    dmSize := SizeOf( TDeviceMode );
    dmPelsWidth := Width;
    dmPelsHeight := Height;
    dmFields := DM_PELSWIDTH or DM_PELSHEIGHT;
 end;
 Result := ChangeDisplaySettings( DeviceMode, CDS_UPDATEREGISTRY );
end;
var
 oldWidth, oldHeight: integer;

procedure TForm1.Button1Click( Sender: TObject );
begin
 oldWidth := GetSystemMetrics( SM_CXSCREEN );
 oldHeight := GetSystemMetrics( SM_CYSCREEN );
 showmessage('You are about to change your Screen Resolution to 800x600');
 SetScreenResolution( 800, 600 );//or your design mode
 form1.position:=poScreenCenter;
 label1.show;
 label2.show;
end;


procedure TForm1.Button2Click(Sender: TObject);
begin
showmessage('This will reset your Screen  Resolution');
SetScreenResolution( oldWidth, oldHeight );
form1.position:=poScreenCenter;
label1.hide;
label2.hide;
end;

procedure TForm1.FormCloseQuery(Sender: TObject; var CanClose: Boolean);
begin
SetScreenResolution( oldWidth, oldHeight );

end;

end.
0
 
LVL 3

Expert Comment

by:tongalite
ID: 6923559
Oops... I left a couple of labels in that code.
edit those out.
:-)
t.
0
 
LVL 3

Assisted Solution

by:VSF
VSF earned 400 total points
ID: 6923828
tongalite:
This is not a very good practice... changing the resolution without asking! Further more, user's system may not support the res you are trying to set!

anas_madani:
Try this, it worked fine t me and can adjust the app resolution!

procedure TForm1.AdjustResolution(oForm:TForm);
var
iPercentage:integer;
begin
if Screen.Width <> 800 then
  begin
    iPercentage:=Round(((Screen.Width-800)/800)*100)+100;
    oForm.ScaleBy(iPercentage,100);
  end;
end;


Hope it helps!
VSF
www.victory.hpg.com.br
www.boatoda.hpg.com.br
0
 
LVL 1

Expert Comment

by:xsoft
ID: 6961529
listening
0
 
LVL 1

Expert Comment

by:pnh73
ID: 9002936
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:

Split between tongalite and VSF

Please leave any comments here within the next seven days.
 
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!
 
Paul (pnh73)
EE Cleanup Volunteer
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
Suggested Courses
Course of the Month14 days, 4 hours left to enroll

800 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question