C# 想要解释一下这个代码吗

C# 想要解释一下这个代码吗,c#,C#,我是c的新手 我用这个代码来获取我的桌面截图。 但我不明白他们的意思。 这是代码 bt = new Bitmap(Screen.PrimaryScreen.Bounds.Width, Screen.PrimaryScreen.Bounds.Height, PixelFormat.Format32bppArgb); 及 有人能给我解释一下这些代码的作用和含义吗 特别是括号内的零件。。 谢谢。Screen.PrimaryScreen.Bounds.Width和Screen.PrimaryScree

我是c的新手 我用这个代码来获取我的桌面截图。 但我不明白他们的意思。 这是代码

bt = new Bitmap(Screen.PrimaryScreen.Bounds.Width, Screen.PrimaryScreen.Bounds.Height, PixelFormat.Format32bppArgb);

有人能给我解释一下这些代码的作用和含义吗

特别是括号内的零件。。 谢谢。

Screen.PrimaryScreen.Bounds.Width和Screen.PrimaryScreen.Bounds.Height获取当前屏幕监视器的宽度和高度。它们用于创建新位图


第二行复制了一个区域的内容:整个屏幕。

这就是为什么你不应该随意从互联网上复制和粘贴代码。除了@Arran的评论,你可以在Google上搜索传递给这些方法的每个参数。步骤1。正确地学习C。第二步。对明显的东西使用文档。例如,阅读第一行的意思,或者直接去那里搜索。此外,您的示例中没有括号。我想你指的是括号。看一下位图类的MSDN,Screen.PrimaryScreen.Bounds.X和Screen.PrimaryScreen.Bounds.Y的含义是什么?还有0,0,Screen.PrimaryScreen.Bounds.Size,CopyPixelOperation.SourceCopy如果你真的需要这种深度的描述,你应该看看注释中所述的MSDN。是您要查找的类。代码中的0,0表示Screen.PrimaryScreen.Bounds.X=0和Screen.PrimaryScreen.Bounds.Y=0?
screenShot.CopyFromScreen(Screen.PrimaryScreen.Bounds.X, Screen.PrimaryScreen.Bounds.Y, 0, 0, Screen.PrimaryScreen.Bounds.Size, CopyPixelOperation.SourceCopy);