C#截圖

        private void FullScreen_Click( )
        {
            //創建圖象,保存將來截取的圖象
            //Bitmap image = new Bitmap(Screen.PrimaryScreen.Bounds.Width, Screen.PrimaryScreen.Bounds.Height);
            Bitmap image = new Bitmap(700, 500);
            Graphics imgGraphics = Graphics.FromImage(image);
            //設置截屏區域 柯樂義
            imgGraphics.CopyFromScreen(new Point(200,300), new Point(0, 0), new Size(700, 500)); //第一個參數是截圖開始座標,第二個參數是要拷貝到的Bitmap的開始位置,保持不變,最後是圖片大小
            //保存
            image.Save("a.png");
            MessageBox.Show("保存成功");
        }

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章