コード例 #1
0
        public CaptureForm()
        {
            InitializeComponent();
            this.Location = new Point(0, 0);
            this.Size     = new Size(Screen.PrimaryScreen.Bounds.Width, Screen.PrimaryScreen.Bounds.Height);

            mHook                       = new MouseHook();
            this.FormClosing           += (s, e) => { mHook.UnLoadHook(); this.DelResource(); };
            imageProcessBox.MouseLeave += (s, e) => this.Cursor = Cursors.Default;
            //后期一些操作历史记录图层
            historyLayer = new List <Bitmap>();
            List <String> items = new List <string>();

            items.AddRange(new String[] { "8", "9", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "21", "22" });
            this.fontBox.SetItems(items);
        }
コード例 #2
0
ファイル: CaptureForm.cs プロジェクト: lxzh/lxzhASS
        public CaptureForm()
        {
            InitializeComponent();
            this.Location = new Point(0, 0);

            //获取屏幕放大比例
            //Graphics graphics = this.CreateGraphics();
            //int dpiX = (int)graphics.DpiX;
            //int dpiY = (int)graphics.DpiY;
            //float scaling=1.0f;
            //if(dpiX==96){
            //    scaling=1.0F;
            //}else if(dpiX==120){
            //    scaling=1.25F;
            //}else if(dpiX==144){
            //    scaling=1.5F;
            //}else if(dpiX==192){
            //    scaling=2.0F;
            //}else{

            //}

            foreach (Screen screen in Screen.AllScreens)
            {
                maxWidth += screen.Bounds.Width;
                if (screen.Bounds.Height > maxHeight)
                {
                    maxHeight = screen.Bounds.Height;
                }
            }
            this.Location = Point.Empty;
            this.Size     = new Size(maxWidth, maxHeight);

            mHook                       = new MouseHook();
            this.FormClosing           += (s, e) => { mHook.UnLoadHook(); this.DelResource(); };
            imageProcessBox.MouseLeave += (s, e) => this.Cursor = Cursors.Default;
            //后期一些操作历史记录图层
            historyLayer = new List <Bitmap>();
            List <String> items = new List <string>();

            items.AddRange(new String[] { "8", "9", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "21", "22" });
            this.fontBox.SetItems(items);
        }