This is a discussion on Can we capture the desktop background image programatically using c#? within the C# Programming forums, part of the Software Development category; Can we capture the desktop background image programatically using c#?...
| |||||||
| Register | FAQ | Members List | Calendar | Mark Forums Read |
| |||
| Yes, we can private static Bitmap bmpScreenshot; private static Graphics gfxScreenshot; // If the user has chosen a path where to save the screenshot if (saveScreenshot.ShowDialog() == DialogResult.OK) { // Hide the form so that it does not appear in the screenshot this.Hide(); // Set the bitmap object to the size of the screen bmpScreenshot = new Bitmap(Screen.PrimaryScreen.Bounds.Width,Screen.Pr imaryScreen.Bounds.Height, PixelFormat.Format32bppArgb); // Create a graphics object from the bitmap gfxScreenshot = Graphics.FromImage(bmpScreenshot); // Take the screenshot from the upper left corner to the right bottom corner gfxScreenshot.CopyFromScreen(Screen.PrimaryScreen. Bounds.X, Screen.PrimaryScreen.Bounds.Y, 0, 0, Screen.PrimaryScreen.Bounds.Size, CopyPixelOperation.SourceCopy); // Save the screenshot to the specified path that the user has chosen bmpScreenshot.Save(saveScreenshot.FileName, ImageFormat.Png); // Show the form again this.Show(); } |
![]() |
| Thread Tools | |
| Display Modes | |
| |
LinkBacks (?)
LinkBack to this Thread: http://www.discussweb.com/c-programming/2249-can-we-capture-desktop-background-image-programatically-using-c.html | |||
| Posted By | For | Type | Date |
| Digg / Programming / Upcoming | This thread | Refback | 07-20-2007 04:30 AM |
| Digg / Programming / Upcoming | This thread | Refback | 07-20-2007 01:48 AM |
| Digg / News / Upcoming | This thread | Refback | 07-20-2007 01:46 AM |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How to set background image for <td> using style property? | poornima | HTML, CSS and Javascript Coding Techniques | 6 | 01-31-2008 12:24 AM |
| Desktop Background Problem | it.wily | Operating Systems | 13 | 01-10-2008 09:34 PM |
| What is a function to capture dynamic values in the web Vuser script? | Shanthi | Testing Tools | 2 | 11-16-2007 04:45 AM |
| How to create an image from panel background Image | S.Vinothkumar | C# Programming | 1 | 10-22-2007 03:52 AM |
| How can we capture the todays screen image programmatically in windows mobile 5.0 poc | mobilegeek | C# Programming | 1 | 07-21-2007 01:46 AM |