Skip to content

Instantly share code, notes, and snippets.

@aspose-com-gists
Last active July 27, 2023 00:24
Show Gist options
  • Save aspose-com-gists/a0918ab26b50f4aaa25213f37eb2e95b to your computer and use it in GitHub Desktop.
Save aspose-com-gists/a0918ab26b50f4aaa25213f37eb2e95b to your computer and use it in GitHub Desktop.

Aspose.Imaging .NET API allows allows programmatically convert your Tiff images to various image formats with high quality in your .NET application or Web service.

You can:

  • convert Tiff frames to images;
  • convert Tiff image to multi page or multi frame image formats;

Interested ?

You may go further at : https://products.aspose.com/imaging/net/

using System;
using System.IO;
using System.Text;
using System.Collections.Generic;
// load the TIF file in an instance of Image
using (var image = Aspose.Imaging.Image.Load(@"template.tif"))
{
// create an instance of BmpOptions
var options = new Aspose.Imaging.ImageOptions.BmpOptions();
// save TIF as a BMP
image.Save(@"output.bmp", options);
}
using System;
using System.IO;
using System.Text;
using System.Collections.Generic;
// load the TIF file in an instance of Image
using (var image = Aspose.Imaging.Image.Load(@"template.tif"))
{
// create an instance of DicomOptions
var options = new Aspose.Imaging.ImageOptions.DicomOptions();
// save TIF as a DICOM
image.Save(@"output.dicom", options);
}
using System;
using System.IO;
using System.Text;
using System.Collections.Generic;
// load the TIF file in an instance of Image
using (var image = Aspose.Imaging.Image.Load(@"template.tif"))
{
// create an instance of EmfOptions
var options = new Aspose.Imaging.ImageOptions.EmfOptions();
// save TIF as a EMF
image.Save(@"output.emf", options);
}
using System;
using System.IO;
using System.Text;
using System.Collections.Generic;
// load the TIF file in an instance of Image
using (var image = Aspose.Imaging.Image.Load(@"template.tif"))
{
// create an instance of GifOptions
var options = new Aspose.Imaging.ImageOptions.GifOptions();
// save TIF as a GIF
image.Save(@"output.gif", options);
}
using System;
using System.IO;
using System.Text;
using System.Collections.Generic;
// load the TIF file in an instance of Image
using (var image = Aspose.Imaging.Image.Load(@"template.tif"))
{
// create an instance of JpegOptions
var options = new Aspose.Imaging.ImageOptions.JpegOptions();
// save TIF as a JPEG
image.Save(@"output.jpeg", options);
}
using System;
using System.IO;
using System.Text;
using System.Collections.Generic;
// load the TIF file in an instance of Image
using (var image = Aspose.Imaging.Image.Load(@"template.tif"))
{
// create an instance of PdfOptions
var options = new Aspose.Imaging.ImageOptions.PdfOptions();
// save TIF as a PDF
image.Save(@"output.pdf", options);
}
using System;
using System.IO;
using System.Text;
using System.Collections.Generic;
// load the TIF file in an instance of Image
using (var image = Aspose.Imaging.Image.Load(@"template.tif"))
{
// create an instance of PngOptions
var options = new Aspose.Imaging.ImageOptions.PngOptions();
// save TIF as a PNG
image.Save(@"output.png", options);
}
using System;
using System.IO;
using System.Text;
using System.Collections.Generic;
// load the TIF file in an instance of Image
using (var image = Aspose.Imaging.Image.Load(@"template.tif"))
{
// create an instance of PsdOptions
var options = new Aspose.Imaging.ImageOptions.PsdOptions();
// save TIF as a PSD
image.Save(@"output.psd", options);
}
using System;
using System.IO;
using System.Text;
using System.Collections.Generic;
// load the TIF file in an instance of Image
using (var image = Aspose.Imaging.Image.Load(@"template.tif"))
{
// create an instance of SvgOptions
var options = new Aspose.Imaging.ImageOptions.SvgOptions();
// save TIF as a SVG
image.Save(@"output.svg", options);
}
using System;
using System.IO;
using System.Text;
using System.Collections.Generic;
// load the TIF file in an instance of Image
using (var image = Aspose.Imaging.Image.Load(@"template.tif"))
{
// create an instance of WmfOptions
var options = new Aspose.Imaging.ImageOptions.WmfOptions();
// save TIF as a WMF
image.Save(@"output.wmf", options);
}
using Aspose.Imaging;
using System;
using System.IO;
using System.Text;
using System.Collections.Generic;
//You can get all image templates from https://github.com/aspose-imaging/Aspose.Imaging-for-.NET/blob/master/Examples/Data/Templates.zip
//After download archive please unpack it and replace templatesFolder variable path with your path to unpacked archive folder
string templatesFolder = @"c:\Users\USER\Downloads\templates\";
// Load the tiff file in an instance of Image
using (var image = Aspose.Imaging.Image.Load(Path.Combine(templatesFolder, @"template.tiff")))
{
// Create an instance of ApngOptions
var exportOptions = new Aspose.Imaging.ImageOptions.ApngOptions();
// Save tiff to apng
image.Save(Path.Combine(templatesFolder, "output.apng"), exportOptions);
File.Delete(Path.Combine(templatesFolder, "output.apng"));
}
using Aspose.Imaging;
using System;
using System.IO;
using System.Text;
using System.Collections.Generic;
//You can get all image templates from https://github.com/aspose-imaging/Aspose.Imaging-for-.NET/blob/master/Examples/Data/Templates.zip
//After download archive please unpack it and replace templatesFolder variable path with your path to unpacked archive folder
string templatesFolder = @"c:\Users\USER\Downloads\templates\";
// Load the tiff file in an instance of Image
using (var image = Aspose.Imaging.Image.Load(Path.Combine(templatesFolder, @"template.tiff")))
{
// Create an instance of BmpOptions
var exportOptions = new Aspose.Imaging.ImageOptions.BmpOptions();
// Save tiff to bmp
image.Save(Path.Combine(templatesFolder, "output.bmp"), exportOptions);
File.Delete(Path.Combine(templatesFolder, "output.bmp"));
}
using Aspose.Imaging;
using System;
using System.IO;
using System.Text;
using System.Collections.Generic;
//You can get all image templates from https://github.com/aspose-imaging/Aspose.Imaging-for-.NET/blob/master/Examples/Data/Templates.zip
//After download archive please unpack it and replace templatesFolder variable path with your path to unpacked archive folder
string templatesFolder = @"c:\Users\USER\Downloads\templates\";
// Load the tiff file in an instance of Image
using (var image = Aspose.Imaging.Image.Load(Path.Combine(templatesFolder, @"template.tiff")))
{
// Create an instance of DicomOptions
var exportOptions = new Aspose.Imaging.ImageOptions.DicomOptions();
// Save tiff to dicom
image.Save(Path.Combine(templatesFolder, "output.dicom"), exportOptions);
File.Delete(Path.Combine(templatesFolder, "output.dicom"));
}
using Aspose.Imaging;
using System;
using System.IO;
using System.Text;
using System.Collections.Generic;
//You can get all image templates from https://github.com/aspose-imaging/Aspose.Imaging-for-.NET/blob/master/Examples/Data/Templates.zip
//After download archive please unpack it and replace templatesFolder variable path with your path to unpacked archive folder
string templatesFolder = @"c:\Users\USER\Downloads\templates\";
// Load the tiff file in an instance of Image
using (var image = Aspose.Imaging.Image.Load(Path.Combine(templatesFolder, @"template.tiff")))
{
// Create an instance of DxfOptions
var exportOptions = new Aspose.Imaging.ImageOptions.DxfOptions(){ TextAsLines = true,ConvertTextBeziers = true};
// Save tiff to dxf
image.Save(Path.Combine(templatesFolder, "output.dxf"), exportOptions);
File.Delete(Path.Combine(templatesFolder, "output.dxf"));
}
using Aspose.Imaging;
using System;
using System.IO;
using System.Text;
using System.Collections.Generic;
//You can get all image templates from https://github.com/aspose-imaging/Aspose.Imaging-for-.NET/blob/master/Examples/Data/Templates.zip
//After download archive please unpack it and replace templatesFolder variable path with your path to unpacked archive folder
string templatesFolder = @"c:\Users\USER\Downloads\templates\";
// Load the tiff file in an instance of Image
using (var image = Aspose.Imaging.Image.Load(Path.Combine(templatesFolder, @"template.tiff")))
{
// Create an instance of EmfOptions
var exportOptions = new Aspose.Imaging.ImageOptions.EmfOptions();
// Save tiff to emf
image.Save(Path.Combine(templatesFolder, "output.emf"), exportOptions);
File.Delete(Path.Combine(templatesFolder, "output.emf"));
}
using Aspose.Imaging;
using System;
using System.IO;
using System.Text;
using System.Collections.Generic;
//You can get all image templates from https://github.com/aspose-imaging/Aspose.Imaging-for-.NET/blob/master/Examples/Data/Templates.zip
//After download archive please unpack it and replace templatesFolder variable path with your path to unpacked archive folder
string templatesFolder = @"c:\Users\USER\Downloads\templates\";
// Load the tiff file in an instance of Image
using (var image = Aspose.Imaging.Image.Load(Path.Combine(templatesFolder, @"template.tiff")))
{
// Create an instance of EmfOptions
var exportOptions = new Aspose.Imaging.ImageOptions.EmfOptions(){ Compress = true };
// Save tiff to emz
image.Save(Path.Combine(templatesFolder, "output.emz"), exportOptions);
File.Delete(Path.Combine(templatesFolder, "output.emz"));
}
using Aspose.Imaging;
using System;
using System.IO;
using System.Text;
using System.Collections.Generic;
//You can get all image templates from https://github.com/aspose-imaging/Aspose.Imaging-for-.NET/blob/master/Examples/Data/Templates.zip
//After download archive please unpack it and replace templatesFolder variable path with your path to unpacked archive folder
string templatesFolder = @"c:\Users\USER\Downloads\templates\";
// Load the tiff file in an instance of Image
using (var image = Aspose.Imaging.Image.Load(Path.Combine(templatesFolder, @"template.tiff")))
{
// Create an instance of GifOptions
var exportOptions = new Aspose.Imaging.ImageOptions.GifOptions();
// Save tiff to gif
image.Save(Path.Combine(templatesFolder, "output.gif"), exportOptions);
File.Delete(Path.Combine(templatesFolder, "output.gif"));
}
using Aspose.Imaging;
using System;
using System.IO;
using System.Text;
using System.Collections.Generic;
//You can get all image templates from https://github.com/aspose-imaging/Aspose.Imaging-for-.NET/blob/master/Examples/Data/Templates.zip
//After download archive please unpack it and replace templatesFolder variable path with your path to unpacked archive folder
string templatesFolder = @"c:\Users\USER\Downloads\templates\";
// Load the tiff file in an instance of Image
using (var image = Aspose.Imaging.Image.Load(Path.Combine(templatesFolder, @"template.tiff")))
{
// Create an instance of Html5CanvasOptions
var exportOptions = new Aspose.Imaging.ImageOptions.Html5CanvasOptions();
// Save tiff to html
image.Save(Path.Combine(templatesFolder, "output.html"), exportOptions);
File.Delete(Path.Combine(templatesFolder, "output.html"));
}
using Aspose.Imaging;
using System;
using System.IO;
using System.Text;
using System.Collections.Generic;
//You can get all image templates from https://github.com/aspose-imaging/Aspose.Imaging-for-.NET/blob/master/Examples/Data/Templates.zip
//After download archive please unpack it and replace templatesFolder variable path with your path to unpacked archive folder
string templatesFolder = @"c:\Users\USER\Downloads\templates\";
// Load the tiff file in an instance of Image
using (var image = Aspose.Imaging.Image.Load(Path.Combine(templatesFolder, @"template.tiff")))
{
// Create an instance of IcoOptions
var exportOptions = new Aspose.Imaging.ImageOptions.IcoOptions();
// Save tiff to ico
image.Save(Path.Combine(templatesFolder, "output.ico"), exportOptions);
File.Delete(Path.Combine(templatesFolder, "output.ico"));
}
using Aspose.Imaging;
using System;
using System.IO;
using System.Text;
using System.Collections.Generic;
//You can get all image templates from https://github.com/aspose-imaging/Aspose.Imaging-for-.NET/blob/master/Examples/Data/Templates.zip
//After download archive please unpack it and replace templatesFolder variable path with your path to unpacked archive folder
string templatesFolder = @"c:\Users\USER\Downloads\templates\";
// Load the tiff file in an instance of Image
using (var image = Aspose.Imaging.Image.Load(Path.Combine(templatesFolder, @"template.tiff")))
{
// Create an instance of Jpeg2000Options
var exportOptions = new Aspose.Imaging.ImageOptions.Jpeg2000Options(){ Codec = Aspose.Imaging.FileFormats.Jpeg2000.Jpeg2000Codec.J2K };
// Save tiff to j2k
image.Save(Path.Combine(templatesFolder, "output.j2k"), exportOptions);
File.Delete(Path.Combine(templatesFolder, "output.j2k"));
}
using Aspose.Imaging;
using System;
using System.IO;
using System.Text;
using System.Collections.Generic;
//You can get all image templates from https://github.com/aspose-imaging/Aspose.Imaging-for-.NET/blob/master/Examples/Data/Templates.zip
//After download archive please unpack it and replace templatesFolder variable path with your path to unpacked archive folder
string templatesFolder = @"c:\Users\USER\Downloads\templates\";
// Load the tiff file in an instance of Image
using (var image = Aspose.Imaging.Image.Load(Path.Combine(templatesFolder, @"template.tiff")))
{
// Create an instance of Jpeg2000Options
var exportOptions = new Aspose.Imaging.ImageOptions.Jpeg2000Options(){ Codec = Aspose.Imaging.FileFormats.Jpeg2000.Jpeg2000Codec.Jp2 };
// Save tiff to jp2
image.Save(Path.Combine(templatesFolder, "output.jp2"), exportOptions);
File.Delete(Path.Combine(templatesFolder, "output.jp2"));
}
using Aspose.Imaging;
using System;
using System.IO;
using System.Text;
using System.Collections.Generic;
//You can get all image templates from https://github.com/aspose-imaging/Aspose.Imaging-for-.NET/blob/master/Examples/Data/Templates.zip
//After download archive please unpack it and replace templatesFolder variable path with your path to unpacked archive folder
string templatesFolder = @"c:\Users\USER\Downloads\templates\";
// Load the tiff file in an instance of Image
using (var image = Aspose.Imaging.Image.Load(Path.Combine(templatesFolder, @"template.tiff")))
{
// Create an instance of JpegOptions
var exportOptions = new Aspose.Imaging.ImageOptions.JpegOptions();
// Save tiff to jpeg
image.Save(Path.Combine(templatesFolder, "output.jpeg"), exportOptions);
File.Delete(Path.Combine(templatesFolder, "output.jpeg"));
}
using Aspose.Imaging;
using System;
using System.IO;
using System.Text;
using System.Collections.Generic;
//You can get all image templates from https://github.com/aspose-imaging/Aspose.Imaging-for-.NET/blob/master/Examples/Data/Templates.zip
//After download archive please unpack it and replace templatesFolder variable path with your path to unpacked archive folder
string templatesFolder = @"c:\Users\USER\Downloads\templates\";
// Load the tiff file in an instance of Image
using (var image = Aspose.Imaging.Image.Load(Path.Combine(templatesFolder, @"template.tiff")))
{
// Create an instance of Jpeg2000Options
var exportOptions = new Aspose.Imaging.ImageOptions.Jpeg2000Options();
// Save tiff to jpeg2000
image.Save(Path.Combine(templatesFolder, "output.jpeg2000"), exportOptions);
File.Delete(Path.Combine(templatesFolder, "output.jpeg2000"));
}
using Aspose.Imaging;
using System;
using System.IO;
using System.Text;
using System.Collections.Generic;
//You can get all image templates from https://github.com/aspose-imaging/Aspose.Imaging-for-.NET/blob/master/Examples/Data/Templates.zip
//After download archive please unpack it and replace templatesFolder variable path with your path to unpacked archive folder
string templatesFolder = @"c:\Users\USER\Downloads\templates\";
// Load the tiff file in an instance of Image
using (var image = Aspose.Imaging.Image.Load(Path.Combine(templatesFolder, @"template.tiff")))
{
// Create an instance of JpegOptions
var exportOptions = new Aspose.Imaging.ImageOptions.JpegOptions();
// Save tiff to jpg
image.Save(Path.Combine(templatesFolder, "output.jpg"), exportOptions);
File.Delete(Path.Combine(templatesFolder, "output.jpg"));
}
using Aspose.Imaging;
using System;
using System.IO;
using System.Text;
using System.Collections.Generic;
//You can get all image templates from https://github.com/aspose-imaging/Aspose.Imaging-for-.NET/blob/master/Examples/Data/Templates.zip
//After download archive please unpack it and replace templatesFolder variable path with your path to unpacked archive folder
string templatesFolder = @"c:\Users\USER\Downloads\templates\";
// Load the tiff file in an instance of Image
using (var image = Aspose.Imaging.Image.Load(Path.Combine(templatesFolder, @"template.tiff")))
{
// Create an instance of PdfOptions
var exportOptions = new Aspose.Imaging.ImageOptions.PdfOptions();
// Save tiff to pdf
image.Save(Path.Combine(templatesFolder, "output.pdf"), exportOptions);
File.Delete(Path.Combine(templatesFolder, "output.pdf"));
}
using Aspose.Imaging;
using System;
using System.IO;
using System.Text;
using System.Collections.Generic;
//You can get all image templates from https://github.com/aspose-imaging/Aspose.Imaging-for-.NET/blob/master/Examples/Data/Templates.zip
//After download archive please unpack it and replace templatesFolder variable path with your path to unpacked archive folder
string templatesFolder = @"c:\Users\USER\Downloads\templates\";
// Load the tiff file in an instance of Image
using (var image = Aspose.Imaging.Image.Load(Path.Combine(templatesFolder, @"template.tiff")))
{
// Create an instance of PngOptions
var exportOptions = new Aspose.Imaging.ImageOptions.PngOptions(){ ColorType = Aspose.Imaging.FileFormats.Png.PngColorType.TruecolorWithAlpha};
// Save tiff to png
image.Save(Path.Combine(templatesFolder, "output.png"), exportOptions);
File.Delete(Path.Combine(templatesFolder, "output.png"));
}
using Aspose.Imaging;
using System;
using System.IO;
using System.Text;
using System.Collections.Generic;
//You can get all image templates from https://github.com/aspose-imaging/Aspose.Imaging-for-.NET/blob/master/Examples/Data/Templates.zip
//After download archive please unpack it and replace templatesFolder variable path with your path to unpacked archive folder
string templatesFolder = @"c:\Users\USER\Downloads\templates\";
// Load the tiff file in an instance of Image
using (var image = Aspose.Imaging.Image.Load(Path.Combine(templatesFolder, @"template.tiff")))
{
// Create an instance of PsdOptions
var exportOptions = new Aspose.Imaging.ImageOptions.PsdOptions();
// Save tiff to psd
image.Save(Path.Combine(templatesFolder, "output.psd"), exportOptions);
File.Delete(Path.Combine(templatesFolder, "output.psd"));
}
using Aspose.Imaging;
using System;
using System.IO;
using System.Text;
using System.Collections.Generic;
//You can get all image templates from https://github.com/aspose-imaging/Aspose.Imaging-for-.NET/blob/master/Examples/Data/Templates.zip
//After download archive please unpack it and replace templatesFolder variable path with your path to unpacked archive folder
string templatesFolder = @"c:\Users\USER\Downloads\templates\";
// Load the tiff file in an instance of Image
using (var image = Aspose.Imaging.Image.Load(Path.Combine(templatesFolder, @"template.tiff")))
{
// Create an instance of SvgOptions
var exportOptions = new Aspose.Imaging.ImageOptions.SvgOptions();
// Save tiff to svg
image.Save(Path.Combine(templatesFolder, "output.svg"), exportOptions);
File.Delete(Path.Combine(templatesFolder, "output.svg"));
}
using Aspose.Imaging;
using System;
using System.IO;
using System.Text;
using System.Collections.Generic;
//You can get all image templates from https://github.com/aspose-imaging/Aspose.Imaging-for-.NET/blob/master/Examples/Data/Templates.zip
//After download archive please unpack it and replace templatesFolder variable path with your path to unpacked archive folder
string templatesFolder = @"c:\Users\USER\Downloads\templates\";
// Load the tiff file in an instance of Image
using (var image = Aspose.Imaging.Image.Load(Path.Combine(templatesFolder, @"template.tiff")))
{
// Create an instance of SvgOptions
var exportOptions = new Aspose.Imaging.ImageOptions.SvgOptions(){ Compress = true };
// Save tiff to svgz
image.Save(Path.Combine(templatesFolder, "output.svgz"), exportOptions);
File.Delete(Path.Combine(templatesFolder, "output.svgz"));
}
using Aspose.Imaging;
using System;
using System.IO;
using System.Text;
using System.Collections.Generic;
//You can get all image templates from https://github.com/aspose-imaging/Aspose.Imaging-for-.NET/blob/master/Examples/Data/Templates.zip
//After download archive please unpack it and replace templatesFolder variable path with your path to unpacked archive folder
string templatesFolder = @"c:\Users\USER\Downloads\templates\";
// Load the tiff file in an instance of Image
using (var image = Aspose.Imaging.Image.Load(Path.Combine(templatesFolder, @"template.tiff")))
{
// Create an instance of TgaOptions
var exportOptions = new Aspose.Imaging.ImageOptions.TgaOptions();
// Save tiff to tga
image.Save(Path.Combine(templatesFolder, "output.tga"), exportOptions);
File.Delete(Path.Combine(templatesFolder, "output.tga"));
}
using Aspose.Imaging;
using System;
using System.IO;
using System.Text;
using System.Collections.Generic;
//You can get all image templates from https://github.com/aspose-imaging/Aspose.Imaging-for-.NET/blob/master/Examples/Data/Templates.zip
//After download archive please unpack it and replace templatesFolder variable path with your path to unpacked archive folder
string templatesFolder = @"c:\Users\USER\Downloads\templates\";
// Load the tiff file in an instance of Image
using (var image = Aspose.Imaging.Image.Load(Path.Combine(templatesFolder, @"template.tiff")))
{
// Create an instance of TiffOptions
var exportOptions = new Aspose.Imaging.ImageOptions.TiffOptions(Aspose.Imaging.FileFormats.Tiff.Enums.TiffExpectedFormat.Default);
// Save tiff to tif
image.Save(Path.Combine(templatesFolder, "output.tif"), exportOptions);
File.Delete(Path.Combine(templatesFolder, "output.tif"));
}
using Aspose.Imaging;
using System;
using System.IO;
using System.Text;
using System.Collections.Generic;
//You can get all image templates from https://github.com/aspose-imaging/Aspose.Imaging-for-.NET/blob/master/Examples/Data/Templates.zip
//After download archive please unpack it and replace templatesFolder variable path with your path to unpacked archive folder
string templatesFolder = @"c:\Users\USER\Downloads\templates\";
// Load the tiff file in an instance of Image
using (var image = Aspose.Imaging.Image.Load(Path.Combine(templatesFolder, @"template.tiff")))
{
// Create an instance of TiffOptions
var exportOptions = new Aspose.Imaging.ImageOptions.TiffOptions(Aspose.Imaging.FileFormats.Tiff.Enums.TiffExpectedFormat.Default);
// Save tiff to tiff
image.Save(Path.Combine(templatesFolder, "output.tiff"), exportOptions);
File.Delete(Path.Combine(templatesFolder, "output.tiff"));
}
using Aspose.Imaging;
using System;
using System.IO;
using System.Text;
using System.Collections.Generic;
//You can get all image templates from https://github.com/aspose-imaging/Aspose.Imaging-for-.NET/blob/master/Examples/Data/Templates.zip
//After download archive please unpack it and replace templatesFolder variable path with your path to unpacked archive folder
string templatesFolder = @"c:\Users\USER\Downloads\templates\";
// Load the tiff file in an instance of Image
using (var image = Aspose.Imaging.Image.Load(Path.Combine(templatesFolder, @"template.tiff")))
{
// Create an instance of WebPOptions
var exportOptions = new Aspose.Imaging.ImageOptions.WebPOptions();
// Save tiff to webp
image.Save(Path.Combine(templatesFolder, "output.webp"), exportOptions);
File.Delete(Path.Combine(templatesFolder, "output.webp"));
}
using Aspose.Imaging;
using System;
using System.IO;
using System.Text;
using System.Collections.Generic;
//You can get all image templates from https://github.com/aspose-imaging/Aspose.Imaging-for-.NET/blob/master/Examples/Data/Templates.zip
//After download archive please unpack it and replace templatesFolder variable path with your path to unpacked archive folder
string templatesFolder = @"c:\Users\USER\Downloads\templates\";
// Load the tiff file in an instance of Image
using (var image = Aspose.Imaging.Image.Load(Path.Combine(templatesFolder, @"template.tiff")))
{
// Create an instance of WmfOptions
var exportOptions = new Aspose.Imaging.ImageOptions.WmfOptions();
// Save tiff to wmf
image.Save(Path.Combine(templatesFolder, "output.wmf"), exportOptions);
File.Delete(Path.Combine(templatesFolder, "output.wmf"));
}
using Aspose.Imaging;
using System;
using System.IO;
using System.Text;
using System.Collections.Generic;
//You can get all image templates from https://github.com/aspose-imaging/Aspose.Imaging-for-.NET/blob/master/Examples/Data/Templates.zip
//After download archive please unpack it and replace templatesFolder variable path with your path to unpacked archive folder
string templatesFolder = @"c:\Users\USER\Downloads\templates\";
// Load the tiff file in an instance of Image
using (var image = Aspose.Imaging.Image.Load(Path.Combine(templatesFolder, @"template.tiff")))
{
// Create an instance of WmfOptions
var exportOptions = new Aspose.Imaging.ImageOptions.WmfOptions(){ Compress = true };
// Save tiff to wmz
image.Save(Path.Combine(templatesFolder, "output.wmz"), exportOptions);
File.Delete(Path.Combine(templatesFolder, "output.wmz"));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment