Gets or sets a value indicating whether to throw an exception instead of returning a null reference (Nothing in Visual Basic)
on certain methods of this
RasterCodecs object.
Syntax
Visual Basic (Declaration) | |
---|
Public Property ThrowExceptionsOnInvalidImages As Boolean |
Visual Basic (Usage) | Copy Code |
---|
Dim instance As RasterCodecs
Dim value As Boolean
instance.ThrowExceptionsOnInvalidImages = value
value = instance.ThrowExceptionsOnInvalidImages
|
C# | |
---|
public bool ThrowExceptionsOnInvalidImages {get; set;} |
Managed Extensions for C++ | |
---|
public: __property bool get_ThrowExceptionsOnInvalidImages();
public: __property void set_ThrowExceptionsOnInvalidImages(
bool value
); |
C++/CLI | |
---|
public:
property bool ThrowExceptionsOnInvalidImages {
bool get();
void set (bool value);
} |
Return Value
A value indicating whether to throw an exception instead of returning a null reference (Nothing in Visual Basic)
on certain methods of this
RasterCodecs object.
Example
Visual Basic | Copy Code |
---|
RasterCodecs.ThrowExceptionsOnInvalidImages
Public Sub ThrowExceptionsOnInvalidImagesExample()
RasterCodecs.Startup()
Dim codecs As RasterCodecs = New RasterCodecs()
codecs.ThrowExceptionsOnInvalidImages = True
Try
Dim image As RasterImage = codecs.Load("some non-image file")
Catch
Console.WriteLine("exception caught - sample sucess")
End Try
codecs.Dispose()
RasterCodecs.Shutdown()
End Sub |
C# | Copy Code |
---|
RasterCodecs.ThrowExceptionsOnInvalidImages public void ThrowExceptionsOnInvalidImagesExample() { RasterCodecs.Startup(); RasterCodecs codecs = new RasterCodecs(); // enable codec exceptions codecs.ThrowExceptionsOnInvalidImages = true; try { RasterImage image = codecs.Load("some non-image file"); } catch { Console.WriteLine("exception caught - sample sucess"); } // Clean up codecs.Dispose(); RasterCodecs.Shutdown(); } |
Remarks
Requirements
Target Platforms: Microsoft .NET Framework 2.0, Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family
See Also