Completed

Aplicación para Obtener un Screenshot de una Pc.

Published on the December 01, 2014 in IT & Programming

About this project

Open

1)    Desarrollar en C# Winforms una aplicación que tome cada 2 segundos un screenshot de la pantalla.
2)    Debe comparar el screenshot con el screenshot de la anterior vez y si es diferente debe convertirlo a jpg y ejecutar asíncronamente un web Service con la IP, el computername, el usuario de la sesión, la fecha y la hora y enviar el pantallazo como array de bytes.
3)    Los WebServices ya existen.

Public class ScreenCapture
{
    [DllImport("user32.dll")]
    private static extern IntPtr GetForegroundWindow();

    [DllImport("user32.dll", CharSet = CharSet.Auto, ExactSpelling = true)]
    public static extern IntPtr GetDesktopWindow();

    [StructLayout(LayoutKind.Sequential)]
    private struct Rect
    {
        public int Left;
        public int Top;
        public int Right;
        public int Bottom;
    } 

    [DllImport("user32.dll")]
    private static extern IntPtr GetWindowRect(IntPtr hWnd, ref Rect rect);

    public static Image CaptureDesktop()
    {
        return CaptureWindow(GetDesktopWindow());
    }

    public static Bitmap CaptureWindow(IntPtr handle)
    {
        var rect = new Rect();
        GetWindowRect(handle, ref rect);
        var bounds = new Rectangle(rect.Left, rect.Top, rect.Right - rect.Left, rect.Bottom - rect.Top);
        var result = new Bitmap(bounds.Width, bounds.Height);

        using (var graphics = Graphics.FromImage(result))
        {
            graphics.CopyFromScreen(new Point(bounds.Left, bounds.Top), Point.Empty, bounds.Size);
        }

        return result;
    }

Category IT & Programming
Subcategory Web development
Is this a project or a position? Project
I currently have I have specifications
Required availability As needed
Experience in this type of projects Yes (I have managed this kind of project before)
Roles needed Developer

Delivery term: December 04, 2014

Skills needed

C#

Other projects posted by T. P.