Exemplo n.º 1
0
        private void BtnRegion_Click(object sender, System.EventArgs e)
        {
            // Choose an input and an output:
            SnagImg.Input  = SNAGITLib.snagImageInput.siiRegion;
            SnagImg.Output = SNAGITLib.snagImageOutput.sioFile;

            // Prompting for the file name is the default, but it cannot hurt to set this explicitly
            SnagImg.OutputImageFile.FileNamingMethod = SNAGITLib.snagOuputFileNamingMethod.sofnmPrompt;

            // Show Preview Window?
            SnagImg.EnablePreviewWindow = ChkPreviewWindow.Checked;

            // Include cursor if set
            SnagImg.IncludeCursor = ChkIncludeCursor.Checked;

            // Try to initiate the capture.. catch any errors and display an
            // appropriate error mesasge.  Here, SnagIt expiration error is shown
            // as an example.
            try
            {
                SnagImg.Capture();
            }
            catch (Exception exception)
            {
                if (SnagImg.LastError == SNAGITLib.snagError.serrSnagItExpired)
                {
                    MessageBox.Show("Unable to capture: SnagIt evaluation has expired");
                }
            }
        }