易截截图软件、单文件、免安装、纯绿色、仅160KB

delphi如何获取屏幕的分辨率

屏幕的分辨率用这个  
  x=GetSystemMetrics(SM_CXSCREEN)  
 
y=GetSystemMetrics(SM_CYSCREEN)  
  同上。
.而且获得屏幕上的像素好像应该使用
screen.pixelsperinch函数
int   GetDeviceCaps(  
   
          HDC   hdc, //  
device-context   handle    
          int   nIndex   //   index  
of   capability   to   query      
        );  
    LOGPIXELSX
Number   of   pixels   per   logical   inch   along   the   screen  
width.  
  LOGPIXELSY Number   of   pixels   per   logical   inch  
along   the   screen   height. 
当我们需要获取所运行程序时计算机的分辨率时,有两种方法:①可以通过访问Delphi提供的SCREEN全局变量,即SCREEN.WIDTH和
SCREEN.HEIGHT以像素点给出屏幕的分辨率。②利用Windows的API函数GetDeviceCaps()来得到所用显示器的分辨率,源代
码如下:
    Application.Initialize;
    Application.CreateForm(TForm1, Form1);
    CASE GetDeviceCaps(GetDC(Form1.Handle),HORZRES) of
    640 : //对640×480分辨率进行处理的代码;
    800 : //对800×600分辨率进行处理的代码;
    1024: //对1024×768分辨率进行处理的代码;
    1280: //对1280×1024分辨率进行处理的代码;
END;
总结:谢谢各位朋友的奉献,可以放置以show事件中,而且用self引用,可降低出错概率!


相关文档:

Delphi 的RTTI机制浅探(续)

http://www.delphibbs.com/delphibbs/dispq.asp?LID=2421470
本文是《Delphi 的RTTI机制浅探》的续篇,上篇地址在:
  http://www.delphibbs.com/delphibbs/dispq.asp?lid=2420610
本文上篇基本上是
RTTI 入门介绍,续篇介绍了所有 TypInfo.pas 中的函数,附加了 Classes.pas、Graphics.pas、Controls.pas
中的 ......

delphi中application.processmessages的作用


delphi中application.processmessages的作用

procedure TForm1.Button2Click(Sender: TObject);
var
   I, J, X, Y: Word;
begin
   I := 0;
   J := 0;
   while I < 64000 do
   begin
     Randomize;
   & ......

Delphi与XML文档

同步程序案例
procedure TGetOrderThread.PostDB(webnr:WideString);
var
  Err: String;
  SetWebnr:WideString;
  xmlDoc: IXMLDocument;
  root: IXMLNode;
  rowc: IXMLNode;//记录数
  rows: IXMLNodeList;//主记录列表
  row: IXMLNode;
  drows: IXMLNodeList;// ......

怎样用DELPHI接收摄像头的图象

community.csdn.net/Expert/topic/3423/3423580.xml?temp=.7675897
主  题:  怎样用DELPHI接收摄像头的图象 
作  者:  benbenpear (笨笨) 
等  级:   
信 誉 值:  100 
所属社区:  Delphi GAME,图形处理/多媒体 
问题点数:  0  ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号