-2

画面をキャプチャして画像ファイルを保存できるC#アプリケーションを作成する必要があります。

お願い助けて!

4

2 に答える 2

1
            Point curPos = new Point(Cursor.Position.X, Cursor.Position.Y);
            Size curSize = new Size();
            curSize.Height = Cursor.Current.Size.Height; curSize.Width = Cursor.Current.Size.Width;
            System.Threading.Thread.Sleep(250);
            Rectangle r1 = Screen.GetBounds(Screen.GetBounds(Point.Empty));
            Bitmap b1 = new Bitmap(r1.Width, r1.Height);
            Graphics g1 = Graphics.FromImage(b1);
            g1.CopyFromScreen(Point.Empty, Point.Empty, r1.Size);
            Rectangle r2 = new Rectangle(curPos, curSize);
            Cursors.Default.Draw(g1, r2);
            b1.Save(@"C:\file1.bmp", ImageFormat.Bmp);
于 2012-12-06T07:44:41.973 に答える
1
ScreenCapture sc = new ScreenCapture();
// capture entire screen, and save it to a file
Image img = sc.CaptureScreen();
// display image in a Picture control named imageDisplay
this.imageDisplay.Image = img;
// capture this window, and save it
sc.CaptureWindowToFile(this.Handle,"C:\\temp2.gif",ImageFormat.Gif);

プロジェクト全体は次のサイトから入手できます:http ://www.developerfusion.com/code/4630/capture-a-screen-shot/

于 2012-12-06T07:46:06.263 に答える