zoukankan      html  css  js  c++  java
  • 设置屏幕分辨率


    /*设置屏幕分辨率  width,Height,Color->SetPixelAndColor(1024,768,32)*/
    bool SetPixelAndColor(HDC  hdc,unsigned int Width,unsigned int Height,int BitsPerPixel)
    {
          DEVMODE   CurMode;
          int   result=1;
          for(int i=0;result;i++)
                result   =  EnumDisplaySettings(NULL,i,&CurMode);
          CurMode.dmPelsWidth          =   Screen-> Width;
          CurMode.dmPelsHeight         =   Screen-> Height;

          if(CurMode.dmPelsWidth!=Width ||CurMode.dmPelsHeight!=Height)
          {
                CurMode.dmPelsWidth    =   Width;
                CurMode.dmPelsHeight   =   Height;
                CurMode.dmBitsPerPel   =   BitsPerPixel;
                CurMode.dmFields   =   DM_BITSPERPEL|DM_PELSWIDTH|DM_PELSHEIGHT;
                result   =   ChangeDisplaySettings(&CurMode, CDS_UPDATEREGISTRY);
                return   (result==DISP_CHANGE_SUCCESSFUL);
          }
          else
                return   false;
    }


    SetPixelAndColor(1024,768,32);


        /*首先得到窗体的默认分辨率,在程序关闭的时候恢复默认分辨率*/
        int sx=Screen->Width;
        int sy=Screen->Height;
        SetPixelAndColor(NULL,sx,sy,32);




  • 相关阅读:
    第一次项目总结
    动画animation
    动画基本
    JQ属性和CSS
    JQ选择器
    关于JS的循环和函数,由入门到放弃
    Js知识点
    课程总结
    移动端开发--项目总总结
    项目总结
  • 原文地址:https://www.cnblogs.com/xe2011/p/e4cc1d783edafad7a05ef0c5222c447a.html
Copyright © 2011-2022 走看看