Leadtools.Codecs Send comments on this topic. | Back to Introduction - All Topics | Help Version 16.5.9.25
CommentsSupported Method
See Also 
Leadtools.Codecs Namespace > RasterCodecs Class : CommentsSupported Method



format
The RasterImageFormat to check
Checks whether the given file format supports comment fields

Syntax

Visual Basic (Declaration) 
Public Shared Function CommentsSupported( _
   ByVal format As RasterImageFormat _
) As Boolean
Visual Basic (Usage)Copy Code
Dim format As RasterImageFormat
Dim value As Boolean
 
value = RasterCodecs.CommentsSupported(format)
C# 
public static bool CommentsSupported( 
   RasterImageFormat format
)
C++/CLI 
public:
static bool CommentsSupported( 
   RasterImageFormat format
) 

Parameters

format
The RasterImageFormat to check

Return Value

true if the format supports comment fields; otherwise it is false.

Example

For an example, refer to RasterCodecs.ReadTags(String,Int32).

Remarks

This is a helper method that can be used to detect if a certain raster file format supports comment fields. For example, ReadComment and RasterCodecs.ReadComments(String,Int32) can be used to read the comments stored in a file. If the file format supports comments, such as JPEG or EXIF, then these methods will successfully return the comments stored.

However, if the format does not support comments, such as BMP, an exception will be thrown by the RasterCodecs objects. You can use CommentsSupported to check if the file supports comments and only call the read methods if the return value is true.

Note that the RasterCodecs option uses this method internally to check if the file supports comments when the CodecsLoadOptions.Comments is set to true and only read the file comments if the file format supports them.

Requirements

Target Platforms: Microsoft .NET Framework 3.0, Windows XP, Windows Server 2003 family, Windows Server 2008 family

See Also