←Select platform

DeleteComment(Stream,int,RasterCommentMetadataType) Method

Summary
Deletes a comment field from a file.
Syntax
C#
C++
public void DeleteComment( 
   Stream stream, 
   int pageNumber, 
   RasterCommentMetadataType type 
) 
public: 
void DeleteComment(  
   Stream^ stream, 
   int pageNumber, 
   RasterCommentMetadataType type 
)  

Parameters

stream
A Stream containing the input file data.

pageNumber
1-based index of the page from which to read the comment.

type
The type of comment. Refer to Types of File Comments.

Remarks

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.

Example
C#
using Leadtools; 
using Leadtools.Codecs; 
using Leadtools.ImageProcessing; 
using Leadtools.ImageProcessing.Color; 
using Leadtools.Svg; 
 
 
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 up 
	codecs.Dispose(); 
} 
 
static class LEAD_VARS 
{ 
   public const string ImagesDir = @"C:\LEADTOOLS22\Resources\Images"; 
} 
Requirements

Target Platforms

Help Version 22.0.2022.4.4
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2022 LEAD Technologies, Inc. All Rights Reserved.

Leadtools.Codecs Assembly

Products | Support | Contact Us | Intellectual Property Notices
© 1991-2022 LEAD Technologies, Inc. All Rights Reserved.