The exception that is thrown when a LEADTOOLS ScreenCapture error occurs.
[SerializableAttribute()]public class ScreenCaptureException : Leadtools.LeadtoolsException, System.Runtime.InteropServices._Exception, System.Runtime.Serialization.ISerializable
<SerializableAttribute()>Public Class ScreenCaptureExceptionInherits Leadtools.LeadtoolsExceptionImplements System.Runtime.InteropServices._Exception, System.Runtime.Serialization.ISerializable
[SerializableAttribute()]public ref class ScreenCaptureException : public Leadtools.LeadtoolsException, System.Runtime.InteropServices._Exception, System.Runtime.Serialization.ISerializable
Imports LeadtoolsImports Leadtools.CodecsImports Leadtools.ScreenCapturePublic Sub scEngine_CaptureInformation(ByVal sender As Object, ByVal e As ScreenCaptureInformationEventArgs) Handles scEngine.CaptureInformation' Define codecs class object to save the imageDim codecs As New RasterCodecs()codecs.ThrowExceptionsOnInvalidImages = True' Save the resulted Imagecodecs.Save(e.Image, Path.Combine(LEAD_VARS.ImagesDir, "CapturedImage.bmp"), RasterImageFormat.Bmp, 24)' NOTE: e.Information is a ScreenCaptureInformation structure filled with information' about the captured image, this information can be used here' Display a MessageBox with the bounds of the capture areaMessageBox.Show("Captured Area Bounds:" & Environment.NewLine & "Top:" & e.Information.Area.Top.ToString() & Environment.NewLine & "Left:" & _e.Information.Area.Left.ToString() & Environment.NewLine & "Right:" + e.Information.Area.Right.ToString() & Environment.NewLine & _"Bottom:" & e.Information.Area.Bottom.ToString())' everything worked finee.Cancel = FalseEnd SubWithEvents scEngine As ScreenCaptureEngine<TestMethod()> _Public Sub ScreenCaptureExceptionExample()ScreenCaptureEngine.Startup()Dim captureInformation As ScreenCaptureInformation = NothingscEngine = New ScreenCaptureEngine()TryMessageBox.Show("After you close this message box," & Environment.NewLine & "press F11 to capture the wallpaper.")Dim image As RasterImage = scEngine.CaptureWallpaper(captureInformation)Catch ex As ScreenCaptureException' LEADTOOLS ScreenCapture ErrorMessageBox.Show(String.Format("Could not capture wallpaper.{0}ScreenCapture error code: {1}{0}Message: {2}", Environment.NewLine, ex.Code, ex.Message))Catch ex As Exception' Other errorsMessageBox.Show(String.Format("Could not capture wallpaper.{0}{1}", Environment.NewLine, ex.Message))End TryScreenCaptureEngine.Shutdown()End SubPublic NotInheritable Class LEAD_VARSPublic Const ImagesDir As String = "C:\Users\Public\Documents\LEADTOOLS Images"End Class
using Leadtools;using Leadtools.Codecs;using Leadtools.ScreenCapture;void scEngine_CaptureInformation(object sender, ScreenCaptureInformationEventArgs e){// Make sure that the image was captured successfullyDebug.Assert(e.Image != null);// Define codecs class object to save the imageRasterCodecs codecs = new RasterCodecs();codecs.ThrowExceptionsOnInvalidImages = true;// Save the resulted Imagecodecs.Save(e.Image,Path.Combine(LEAD_VARS.ImagesDir,"Out_CapturedImage.bmp"), RasterImageFormat.Bmp, 24);// NOTE: e.Information is a ScreenCaptureInformation structure filled with information// about the captured image, this information can be used here// Display a MessageBox with the bounds of the capture areaMessageBox.Show("Captured Area Bounds:\n" +"Top:" + e.Information.Area.Top.ToString() + "\n" +"Left:" + e.Information.Area.Left.ToString() + "\n" +"Right:" + e.Information.Area.Right.ToString() + "\n" +"Bottom:" + e.Information.Area.Bottom.ToString());// everything worked finee.Cancel = false;}public void ScreenCaptureExceptionExample(){ScreenCaptureEngine.Startup();ScreenCaptureEngine scEngine = new ScreenCaptureEngine();ScreenCaptureInformation captureInformation = null;scEngine.CaptureInformation += new EventHandler<ScreenCaptureInformationEventArgs>(scEngine_CaptureInformation);try{MessageBox.Show("After you close this message box,\npress F11 to capture the wallpaper.");RasterImage image = scEngine.CaptureWallpaper(captureInformation);}catch (ScreenCaptureException ex){//LEADTOOLS ScreenCapture ErrorMessageBox.Show(string.Format("Could not capture wallpaper.{0}ScreenCapture error code: {1}{0}Message: {2}", Environment.NewLine, ex.Code, ex.Message));}catch (Exception ex){// Other errorsMessageBox.Show(string.Format("Could not capture wallpaper.{0}{1}", Environment.NewLine, ex.Message));}ScreenCaptureEngine.Shutdown();}static class LEAD_VARS{public const string ImagesDir = @"C:\Users\Public\Documents\LEADTOOLS Images";}
ScreenCaptureException Members
Leadtools.ScreenCapture Namespace
ScreenCaptureInformation Class
ScreenCaptureInformationEventArgs Class
ScreenCaptureOptions Structure
|
Products |
Support |
Feedback: ScreenCaptureException Class - Leadtools.ScreenCapture |
Introduction |
Help Version 19.0.2017.3.22
|

Raster .NET | C API | C++ Class Library | JavaScript HTML5
Document .NET | C API | C++ Class Library | JavaScript HTML5
Medical .NET | C API | C++ Class Library | JavaScript HTML5
Medical Web Viewer .NET
Your email has been sent to support! Someone should be in touch! If your matter is urgent please come back into chat.
Chat Hours:
Monday - Friday, 8:30am to 6pm ET
Thank you for your feedback!
Please fill out the form again to start a new chat.
All agents are currently offline.
Chat Hours:
Monday - Friday
8:30AM - 6PM EST
To contact us please fill out this form and we will contact you via email.