Click or drag to resize

JpegEncoderCopyJpegWithNewMarkers Method

These methods perform a lossless copy of the JPEG image data into a new image while replacing the JPEG metadata with new metadata.
Examples
[New Example] (C#)
IptcCollection iptc = new IptcCollection();
iptc.Add(new IptcTag(2, 25, 0, "Testing CopyJpegMarkers"));
FileStream fsIn = new FileStream("myimageIn.jpg", FileMode.Open, FileAccess.Read);
FileStream fsOut = new FileStream("myimageOut.jpg", FileMode.Create, FileAccess.Write);
JpegEncoder jpeg = new JpegEncoder();
jpeg.IptcTags = iptc;
jpeg.CopyJpegWithNewMarkers(fsIn,fsOut);
fsIn.Close();
fsOut.Close();
[New Example] (Visual Basic)
Dim iptc As IptcCollection = new IptcCollection()
iptc.Add(New IptcTag(2, 25, 0, "Testing CopyJpegMarkers"))
Dim fsIn As FileStream = New FileStream("myimageIn.jpg", FileMode.Open, FileAccess.Read)
Dim fsOut As FileStream = New FileStream("myimageOut.jpg", FileMode.Create, FileAccess.Write)
Dim jpeg As JpegEncoder = New JpegEncoder()
jpeg.IptcTags = iptc
jpeg.CopyJpegWithNewMarkers(fsIn, fsOut)
fsIn.Close()
fsOut.Close()
Overload List
  NameDescription
Public methodCode exampleCopyJpegWithNewMarkers(Stream, Stream)
Performs a lossless copy of the JPEG image data into a new image while replacing the JPEG metadata with new metadata.
Public methodCode exampleCopyJpegWithNewMarkers(String, String)
These methods perform a lossless copy of the JPEG image data into a new image while replacing the JPEG metadata with new metadata.
Public methodCode exampleCopyJpegWithNewMarkers(Stream, Stream, JpegMarkerCopyFlags)
These methods perform a lossless copy of the JPEG image data into a new image while replacing the JPEG metadata with new metadata.
Public methodCode exampleCopyJpegWithNewMarkers(String, String, JpegMarkerCopyFlags)
These methods perform a lossless copy of the JPEG image data into a new image while replacing the JPEG metadata with new metadata.
Top
Examples
[New Example] (C#)
IptcCollection iptc = new IptcCollection();
iptc.Add(new IptcTag(2, 25, 0, "Testing CopyJpegMarkers"));
FileStream fsIn = new FileStream("myimageIn.jpg", FileMode.Open, FileAccess.Read);
FileStream fsOut = new FileStream("myimageOut.jpg", FileMode.Create, FileAccess.Write);
JpegEncoder jpeg = new JpegEncoder();
jpeg.IptcTags = iptc;
jpeg.CopyJpegWithNewMarkers(fsIn,fsOut);
fsIn.Close();
fsOut.Close();
[New Example] (Visual Basic)
Dim iptc As IptcCollection = new IptcCollection()
iptc.Add(New IptcTag(2, 25, 0, "Testing CopyJpegMarkers"))
Dim fsIn As FileStream = New FileStream("myimageIn.jpg", FileMode.Open, FileAccess.Read)
Dim fsOut As FileStream = New FileStream("myimageOut.jpg", FileMode.Create, FileAccess.Write)
Dim jpeg As JpegEncoder = New JpegEncoder()
jpeg.IptcTags = iptc
jpeg.CopyJpegWithNewMarkers(fsIn, fsOut)
fsIn.Close()
fsOut.Close()
See Also