LosslessJpeg.Write Method (String)

Writes the image to to the specified file.

Namespace: Aurigma.GraphicsMill.Codecs
Assembly: Aurigma.GraphicsMill (in Aurigma.GraphicsMill.dll)

Syntax

C#
public void Write(
       
string fileName
)

Parameters

fileName

Type: System.String

The name of the file to save the result.

Remarks

This method is useful for updating metadata.

Examples

C#
using (var losslessJpeg = new LosslessJpeg(@"Images\in.jpg"))
{
   
// IPTC
   
if (losslessJpeg.Iptc == null)
        losslessJpeg
.Iptc = new IptcDictionary();
    losslessJpeg
.Iptc[IptcDictionary.Caption] = "Mountain";

   
// EXIF
   
if (losslessJpeg.Exif == null)
        losslessJpeg
.Exif = new ExifDictionary();
    losslessJpeg
.Exif[ExifDictionary.Software] = "Aurigma Graphics Mill";

   
// XMP
   
var xmp = new XmpData();
   
if (losslessJpeg.Xmp != null)
        xmp
.Load(losslessJpeg.Xmp);
   
var node = new XmpValueNode(XmpNodeType.SimpleProperty, "John Wood", XmpTagNames.DCCreator);
    xmp
.AddNode(node);
    losslessJpeg
.Xmp = xmp.Save();

   
// Adobe image resource blocks
   
if (losslessJpeg.AdobeResources == null)
        losslessJpeg
.AdobeResources = new AdobeResourceDictionary();
   
var arBlock = new AdobeResourceBlock("Copyright", new byte[] { 1 });
    losslessJpeg
.AdobeResources[0x040A] = arBlock;

    losslessJpeg
.Write(@"Images\Output\out.jpg");
}

See Also

Reference