开发者

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 calculat开发者_开发技巧ion to his email.

How can that be done?


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

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜