C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Reviews   Communities   Interview   Jobs   Projects   Training   Your Ad Here    
Silverlight Games | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Polls | Revenue Sharing | Lobby | Gift Shop |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...






Resources » Code Snippets » Images »

Capture your desktop


Posted Date: 27 Oct 2009    Resource Type: Code Snippets    Category: Images
Author: Shunmuganathan MMember Level: Diamond    
Rating: 1 out of 5Points: 10



We can capture your desktop by using the following code.

Use the following namespaces

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Windows.Forms.VisualStyles;
using System.Drawing.Drawing2D;



Use the following code


System.Windows.Forms.PictureBox MyPictureBox = new System.Windows.Forms.PictureBox();
Bitmap MyBitmap = new Bitmap(Screen.PrimaryScreen.Bounds.Width, Screen.PrimaryScreen.Bounds.Height);
Graphics MyGraphics = Graphics.FromImage(MyBitmap);
MyGraphics.CopyFromScreen(0, 0, 0, 0, MyBitmap.Size);
MyGraphics.Dispose();
MyPictureBox.Image = MyBitmap;
MyPictureBox.Size = MyBitmap.Size;



Code Explanation

1. Create an instance of PictureBox
2. Create an instance of Bitmap by capturing the current screen
3. By using the class Graphics form a Bitmap
4. Assign the Image into the Picturebox

By
Nathan



Responses


No responses found. Be the first to respond and make money from revenue sharing program.

Feedbacks      
Popular Tags   What are tags ?   Search Tags  
Sign In to add tags.
Capture your desktop using c#  .  Capture your desktop  .  

Post Feedback


This is a strictly moderated forum. Only approved messages will appear in the site. Please use 'Spell Check' in Google toolbar before you submit.
You must Sign In to post a response.
Next Resource: Jquery Image slidShow
Return to Discussion Resource Index
Post New Resource
Category: Images


Post resources and earn money!
 
More Resources



dotNet Slackers

About Us    Contact Us    Privacy Policy    Terms Of Use