草庐IT

PrimaryScreen

全部标签

c# - 无法使用变量名保存位图图像

我是C#的新手,我试图在单击按钮时保存位图图像。为此,我正在使用visualstudio2010。我可以通过传递一个特定的字符串作为文件名来保存我的图像。这是我保存图像的代码:-privatevoidbutton1_Click(objectsender,EventArgse){bmpScreenshot=newBitmap(Screen.PrimaryScreen.Bounds.Width,Screen.PrimaryScreen.Bounds.Height,PixelFormat.Format32bppArgb);gfxScreenshot=Graphics.FromImage(bm

c# - 如何抓取图像并将其保存在文件夹中 [c# windows 应用程序]

我正在使用C#创建一个Windows应用程序。我有一个按钮应该捕获图像(整个桌面屏幕)并将其保存在一个文件夹中。我还需要显示图像的预览。 最佳答案 Graphics.CopyFromScreenMethod示例代码:Bitmapbmp=newBitmap(Screen.PrimaryScreen.Bounds.Size.Width,Screen.PrimaryScreen.Bounds.Size.Height);Graphicsg=Graphics.FromImage(bmp);g.CopyFromScreen(0,0,0,0,Sc

c# - PrimaryScreen.Size 的问题

一段时间以来,我对Screen.PrimaryScreen.Bounds.Size没问题,但在连接到大屏幕电视的Windows7计算机上,它给了我不正确的值。我在别处阅读以尝试SystemInformation.PrimaryMonitorSize但给出相同的值。当我右键单击桌面以获取屏幕分辨率时,它显示1920x1080。以上两个给我1280x720。我也尝试过WPF版本:varw=System.Windows.SystemParameters.PrimaryScreenWidth;varh=System.Windows.SystemParameters.PrimaryScreenH

c# - 如何使用 Windows API 捕获屏幕和鼠标指针?

我正在使用下面的代码在位图中捕获屏幕。屏幕已捕获,但我无法将鼠标指针放在屏幕上。您能否建议一些替代方法以便也捕获鼠标?privateBitmapCaptureScreen(){//Sizesizeishowbiganareatocapture//pointOriginistheupperleftcorneroftheareatocaptureintwidth=Screen.PrimaryScreen.Bounds.X+Screen.PrimaryScreen.Bounds.Width;intheight=Screen.PrimaryScreen.Bounds.Y+Screen.Prim

c# - 如何使用 Windows API 捕获屏幕和鼠标指针?

我正在使用下面的代码在位图中捕获屏幕。屏幕已捕获,但我无法将鼠标指针放在屏幕上。您能否建议一些替代方法以便也捕获鼠标?privateBitmapCaptureScreen(){//Sizesizeishowbiganareatocapture//pointOriginistheupperleftcorneroftheareatocaptureintwidth=Screen.PrimaryScreen.Bounds.X+Screen.PrimaryScreen.Bounds.Width;intheight=Screen.PrimaryScreen.Bounds.Y+Screen.Prim

c# - 将屏幕捕获到位图中

我想在我的代码中捕获屏幕以获取图像-就像使用键盘上的“打印屏幕”按钮一样。有没有人知道如何做到这一点?我没有起点。 最佳答案 如果使用.NET2.0(或更高版本)框架,您可以使用CopyFromScreen()方法详述在这里:http://www.geekpedia.com/tutorial181_Capturing-screenshots-using-Csharp.html//Createanewbitmap.varbmpScreenshot=newBitmap(Screen.PrimaryScreen.Bounds.Width,

c# - 将屏幕捕获到位图中

我想在我的代码中捕获屏幕以获取图像-就像使用键盘上的“打印屏幕”按钮一样。有没有人知道如何做到这一点?我没有起点。 最佳答案 如果使用.NET2.0(或更高版本)框架,您可以使用CopyFromScreen()方法详述在这里:http://www.geekpedia.com/tutorial181_Capturing-screenshots-using-Csharp.html//Createanewbitmap.varbmpScreenshot=newBitmap(Screen.PrimaryScreen.Bounds.Width,