Code to Get a snap shot of window using c#.net

Get snap shot of window




using System.Drawing;
using System.IO;
using System.Text;
//file name is created based on a time
File_name.Text = System.DateTime.Now.ToShortTimeString();
string file_name = File_name.Text.Replace(':', '-');
Bitmap image = new Bitmap(System.Windows.Forms.Screen.PrimaryScreen.Bounds.Width, System.Windows.Forms.Screen.PrimaryScreen.Bounds.Height, System.Drawing.Imaging.PixelFormat.Format32bppArgb);

System.Drawing.Graphics graphics = System.Drawing.Graphics.FromImage(image); graphics.CopyFromScreen(System.Windows.Forms.Screen.PrimaryScreen.Bounds.X, System.Windows.Forms.Screen.PrimaryScreen.Bounds.Y, 0, 0, System.Windows.Forms.Screen.PrimaryScreen.Bounds.Size, System.Drawing.CopyPixelOperation.SourceCopy);
image.Save("C:/temp/" + file_name.ToString()+".jpg");


Note:

If you want to take a snap shot for particualr timer interval, just add a meta-tag inside head tag


meta http-equiv="refresh" content="60"


60 refers the page refreshing time in a seconds..


Comments

Author: vijayanandh06 Apr 2010 Member Level: Gold   Points : 2

Text to speech in asp.net with c#

Text To Speech


Download and install the Microsoft Speech SDK
Create a new project in Visual Studio
Add a reference to the Microsoft Speech Object Library COM object
Use the following code to record your speech to a .wav file…

SpeechLib.SpFileStream SpeechFileStream;
SpeechFileStream = new SpeechLib.SpFileStreamClass();
SpeechFileStream.Open(@"c:\test.wav", SpeechLib.SpeechStreamFileMode.SSFMCreateForWrite, false);
SpeechLib.SpVoice spv = new SpeechLib.SpVoice();
spv.AudioOutputStream = SpeechFileStream;
spv.Speak("I'm alive!", SpeechLib.SpeechVoiceSpeakFlags.SVSFDefault);
SpeechFileStream.Close();

Author: minal10 May 2010 Member Level: Silver   Points : 1

you can refer:

http://www.velocityreviews.com/forums/t64719-printing-pdf-or-scanned-document-via-asp-net-at-network-printer.html



  • Do not include your name, "with regards" etc in the comment. Write detailed comment, relevant to the topic.
  • No HTML formatting and links to other web sites are allowed.
  • This is a strictly moderated site. Absolutely no spam allowed.
  • Name:
    Email: