EvilZone

Programming and Scripting => .NET Framework => : bubzuru August 01, 2012, 11:22:31 PM

: (C#) Take ScreenShot
: bubzuru August 01, 2012, 11:22:31 PM
Save (full)Screen Shot To The Disk

: (c#)
        //Save Screen Shot To Disk
        public void SaveScreenShot(string path)
        {
          Bitmap  bmpScreenshot = new Bitmap(Screen.PrimaryScreen.Bounds.Width,     Screen.PrimaryScreen.Bounds.Height, System.Drawing.Imaging.PixelFormat.Format32bppArgb);
          Graphics gfxScreenshot = Graphics.FromImage(bmpScreenshot);
          gfxScreenshot.CopyFromScreen(Screen.PrimaryScreen.Bounds.X, Screen.PrimaryScreen.Bounds.Y, 0, 0, Screen.PrimaryScreen.Bounds.Size, CopyPixelOperation.SourceCopy);
          bmpScreenshot.Save(path, System.Drawing.Imaging.ImageFormat.Png);
        }
: Re: (C#) Take ScreenShot
: jyggorath December 03, 2013, 10:18:22 AM
What libraries does Bitmap, Screen, Graphics, CopyPixelOperation and Imaging belong to?
: Re: (C#) Take ScreenShot
: ArkPhaze January 27, 2014, 03:51:52 AM
What libraries does Bitmap, Screen, Graphics, CopyPixelOperation and Imaging belong to?

You mean namespaces within the BCL? System.Drawing. Seems weird that he is explicitly showing that within the code on only some of the objects within the namespace, and not all, or... not declaring that the namespace is being used at the top and avoiding the explicit declarations within the function...

No call to Dispose() either anywhere here, which isn't very good.