Monday, 6 April 2015

Automatically Take Snap Shots Capturing Interval Using Bitmap in Window Application or Web Application C#

Automatically Take Snap Shots Capturing

Automatically Take A Screen Capture Particular Interval Time Save To Date Time as  Name Using Window Application.

                              
                                 DEMO




                              
                                   Download Coding
                                        
                                                         Download

                                     C# CODING


using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Windows.Forms;
using System.Drawing;
using System.Drawing.Imaging;

public partial class ScreeeCapturen : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        string a = DateTime.Now.Day.ToString();
        string b = DateTime.Now.Month.ToString();
        string c = DateTime.Now.Year.ToString();

        string d = DateTime.Now.Hour.ToString();
        string f = DateTime.Now.Minute.ToString();
        string g = DateTime.Now.Second.ToString() + ".00";

 string e1 = "Date=" + a + "-" + b + "-" + c + "&&Time=" + d + "." + f + "." + g;

        Bitmap bitmap = new Bitmap(Screen.PrimaryScreen.Bounds.Width, Screen.PrimaryScreen.Bounds.Height);

        Graphics graphics = Graphics.FromImage(bitmap as System.Drawing.Image);

        graphics.CopyFromScreen(25, 25, 25, 25, bitmap.Size);

        bitmap.Save(@"D:\Capturing\"+e1+".png"ImageFormat.Bmp);

       // bitmap.Save(@"D:\Capturing\" + e1 + ".png", ImageFormat.Bmp);

       // bitmap.Save(@"D:\Capturing\" + e1 + ".jpg", ImageFormat.Bmp);

       // bitmap.Save(@"D:\Capturing\" + e1 + ".bmp", ImageFormat.Bmp);

    }

}
































0 comments:

Post a Comment