How do I create "Send to Email" functionality along with Screenshot?
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, 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);
精彩评论