meetpd
meetpd

Reputation: 9219

How do I create "Send to Email" functionality along with Screenshot?

I need to create a webpage which will have following features:

  1. It will have a simple calculator.
  2. There will be an "Send this calculation to my email" function. User enters his email in a textbox, and we need to send the screenshot of that calculation to his email.

How can that be done?

Upvotes: 0

Views: 387

Answers (1)

rahularyansharma
rahularyansharma

Reputation: 10755

For taking the screenshot of your screen this is the simple code in C#

To create a screenshot in c# we need to use drawing api of the .net framework

First you have import System.Drawing.Imaging name space with following code...

using System.Drawing.Imaging;

here is the code in C# for screenshot.

int screenWidth = Screen.GetBounds(new Point(0, 0)).Width;
int screenHeight = Screen.GetBounds(new Point(0, 0)).Height;
Bitmap bmpScreenShot = new Bitmap(screenWidth, screenHeight);
Graphics gfx = Graphics.FromImage((Image)bmpScreenShot);
gfx.CopyFromScreen(0, 0, 0, 0, new Size(screenWidth, screenHeight));
bmpScreenShot.Save("test.jpg", ImageFormat.Jpeg);

Upvotes: 1

Related Questions