Deletes a comment field from a file.
public void DeleteComment(string fileName,int pageNumber,Leadtools.RasterCommentMetadataType type)
Public Overloads Sub DeleteComment( _ByVal fileName As String, _ByVal pageNumber As Integer, _ByVal type As Leadtools.RasterCommentMetadataType _)
public void DeleteComment(string fileName,int pageNumber,Leadtools.RasterCommentMetadataType type)
function Leadtools.Codecs.RasterCodecs.DeleteComment(String,Int32,RasterCommentMetadataType)(fileName ,pageNumber ,type)
public:void DeleteComment(String^ fileName,int pageNumber,Leadtools.RasterCommentMetadataType type)
fileName
A String containing the input file name.
pageNumber
1-based index of the page from which to read the comment.
type
The type of comment. Refer to Types of File Comments.
This function only applies to TIF, EXIF, JPEG or JPEG 2000 files.
You can use CommentsSupported to determine whether a certain file format supports comments.
using Leadtools;using Leadtools.Codecs;using Leadtools.ImageProcessing;using Leadtools.ImageProcessing.Color;using Leadtools.Svg;using LeadtoolsExamples.Common;public void DeleteCommentExample(){RasterCodecs codecs = new RasterCodecs();string srcFileName = Path.Combine(LEAD_VARS.ImagesDir, "Test.jpg");RasterCommentMetadataType commentType = RasterCommentMetadataType.IptcKeywords;RasterCommentMetadata comment = codecs.ReadComment(srcFileName, 1, commentType);if (comment == null)Debug.WriteLine("comment is already missing!");else{codecs.DeleteComment(srcFileName, 1, commentType);comment = codecs.ReadComment(srcFileName, 1, commentType);if (comment != null)Debug.WriteLine("comment is still there!");}// Clean upcodecs.Dispose();}static class LEAD_VARS{public const string ImagesDir = @"C:\Users\Public\Documents\LEADTOOLS Images";}
Imports LeadtoolsImports Leadtools.CodecsImports Leadtools.ImageProcessingImports Leadtools.ImageProcessing.ColorImports Leadtools.DrawingImports Leadtools.SvgPublic Sub DeleteCommentExample()Dim codecs As New RasterCodecs()Dim srcFileName As String = Path.Combine(LEAD_VARS.ImagesDir, "Test.jpg")Dim commentType As RasterCommentMetadataType = RasterCommentMetadataType.IptcKeywordsDim comment As RasterCommentMetadata = codecs.ReadComment(srcFileName, 1, commentType)If (comment Is Nothing) ThenDebug.WriteLine("comment is already missing!")Elsecodecs.DeleteComment(srcFileName, 1, commentType)comment = codecs.ReadComment(srcFileName, 1, commentType)If (Not comment Is Nothing) ThenDebug.WriteLine("comment is still there!")End IfEnd If' Clean upcodecs.Dispose()End SubPublic NotInheritable Class LEAD_VARSPublic Const ImagesDir As String = "C:\Users\Public\Documents\LEADTOOLS Images"End Class
|
Products |
Support |
Feedback: DeleteComment(String,Int32,RasterCommentMetadataType) Method - Leadtools.Codecs |
Introduction |
Help Version 19.0.2017.6.16
|

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.