Showing posts with label Snap Shots. Show all posts
Showing posts with label Snap Shots. Show all posts

Automatically Take Snap Shots Store in SQL DataBase Table Using WindowApplication C#

Automatically Take Snap Shots Store in SQL DataBase Table 

Automatically Take a Snap Shots  Store In Database Table as Well as Pc  Path Laocation Using Window Application C#.


http://dotnetdrizzles.blogspot.in/2015/04/automatically-take-snap-shots-capturing.html

http://dotnetdrizzles.blogspot.in/2015/04/capture-screen-shot-automatically-using.html




                                  DEMO



               
                             C# CODING


using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Data.SqlClient;

namespace WindowsFormsApplication2
{
    public partial class ScreenCapture : Form
    {
        public ScreenCapture()
        {
            InitializeComponent();
        }

        private void ScreenCapture_Load(object sender, EventArgs e)
        {
            Timer timer = new Timer();
            timer.Interval = (1 * 10000); // 10 secs
            timer.Tick += new EventHandler(ScreenCapture_Load);
            timer.Start();
                      
            Bitmap bmp = new Bitmap(Screen.PrimaryScreen.Bounds.Width, Screen.PrimaryScreen.Bounds.Height);
            using (Graphics g = Graphics.FromImage(bmp))
            {

                g.CopyFromScreen(0, 0, 0, 0, Screen.PrimaryScreen.Bounds.Size);

                bmp.Save(@"E:\New folder (2)\image.jpg");

                pictureBox1.Image = bmp;


                string date1 = DateTime.Now.Hour.ToString() + "_" + DateTime.Now.Minute.ToString() + "_" + DateTime.Now.Second.ToString() + "_" + DateTime.Now.Millisecond.ToString();
                string picname = "src";
                string path = Application.StartupPath.Substring(0, Application.StartupPath.LastIndexOf("bin"));
                Bitmap imgImage = new Bitmap(pictureBox1.Image);
        imgImage.Save(path + "\\file\\" + picname + "_" + date1 + ".jpg");

                SqlConnection  con = new SqlConnection(@"Data Source=(LocalDB)\v11.0;AttachDbFilename=C:\Users\drizzle\Documents\Visual Studio 2012\WindowsFormsApplication2\WindowsFormsApplication2\Database1.mdf;Integrated Security=True");
                con.Open();
          SqlCommand cmd1 = new SqlCommand
            ("insert  into capture(imagename,imagepath)values('" + picname + "_" + date1 + "','" + "file/" + picname + "_" + date1 + "')", con);
                cmd1.ExecuteNonQuery();


            }
        }
    }
}



First - Add New Window Form - DataBase Table Fields Create 




Next - Add - Picture Box - From ToolBox -Add Folder To Solution Explorer






Next - Insert DataBase Fileds - Add Capturing Image To file   Folder - Save 






Next - Run[F5] - Automatically Capture Snap Shots - Show Picture box






Show Capturing Images - bin - File - Images





Next - Show The DataBase Table






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);

    }

}



First - Add New Form - Add NameSpaces - Call Windows Activity




Next - Add Reference - Right Click - Project Name - Add Reference Click





Next - FrameWork - System.Windows.Forums   - OK






Image Save To DataTime Name  - Particular folder






Next - Add Timer - Set Interval - Add - Script Manager 






Next - Run[F5]  - Particular Interval Take Snap Shots











Capture Screen Shot Automatically Using Bitmap in Window Application Or Web Application C#

Capture Screen Shot Automatically

Capturing Screenshots System Automatically in Bitmap Images Save To Folder in Window Application Or Web Application.

                            DEMO




                        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)
    {

        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\CapturingImage.bmp", ImageFormat.Bmp);

    }

}



First - Add NEw Web Form - Add NameSpaces For 

Call Windows Activity





Next - Solution Explorer - Project Name - Right Click - Add Reference 





Next - Select Framwork  - System.Windows.Forms  - OK





Next - Add The Form Page Load Capturing Coding





Next - Run [F5]  - Page Load Get Screen Shot & Saved To Given Path.






Open & View  The Captured Picture