开发者

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

开发者 https://www.devze.com 2023-03-16 03:38 出处:网络
I need to create a webpage which will have following features: It will have a simple calculator. There will be an \"Send this calculation to my email\" function. User enters his email in a textbox,

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

精彩评论

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

关注公众号