Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

screen management in delphi language

Posted on 2003-03-03
5
Medium Priority
?
237 Views
Last Modified: 2010-04-04
i want to know how to change the screen resolution and access(pixel manipulating) it directly in delphi language
0
Comment
Question by:am05mhz
[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 21

Expert Comment

by:ziolko
ID: 8062922
look ta: ChangeDisplaySettings()
ziolko.
0
 
LVL 2

Accepted Solution

by:
steve_hsk earned 400 total points
ID: 8063605
Hi Am05Mhz,

Part 1 : - Screen Resolution

To get the current resolution :-

USES Windows;

VAR OldWidth, OldHeight: integer;

PROCEDURE TForm1.Button1Click(Sender: TObject);
BEGIN
  OldWidth := GetSystemMetrics(SM_CXSCREEN);
  OldHeight := GetSystemMetrics(SM_CYSCREEN);
END;

To change the resolution :-

USES Windows;

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;

PART 2 : Accessing Desktop ?!?
Unsure if you want to draw on the desktop, or put the screen into a special graphics mode ... let me know if you need more :

FUNCTION windowsDesktopCanvas: TCanvas;
VAR DC: HDc;
BEGIN
    DC := getWindowDC ( GetDeskTopWindow );
    result := TCanvas.Create;
    result.Handle := DC;
   
    // Now do drawing on result as you would TCanvas eg :
    result.FillRect(...);
END;

Hope this helps,
Steve
0
 

Expert Comment

by:CleanupPing
ID: 9316954
am05mhz:
This old question needs to be finalized -- accept an answer, split points, or get a refund.  For information on your options, please click here-> http:/help/closing.jsp#1 
EXPERTS:
Post your closing recommendations!  No comment means you don't care.
0
 
LVL 5

Expert Comment

by:snehanshu
ID: 10033406
Hi!
No comment has been added lately and this question is therefore classified abandoned.

If asker wishes to close the question, then refer to
http://www.experts-exchange.com/help/closing.jsp

Otherwise, I will leave a recommendation in the Cleanup topic area that this question is:

Answered by: steve_hsk

Please leave any comments here within the next seven days. It is assumed that any participant not responding to this request is no longer interested in its final disposition.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

...Snehanshu
EE Cleanup Volunteer
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
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…
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
Suggested Courses

704 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