This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Load the image. | |
com.aspose.imaging.RasterImage rasterImage = (com.aspose.imaging.RasterImage)com.aspose.imaging.Image.Load("image.png"); | |
// Before cropping, the image should be cached for better performance. | |
if (!rasterImage.isCached()) | |
{ | |
rasterImage.cacheData(); | |
} | |
// Create an instance of Rectangle class with desired size and crop the image. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Load image | |
com.aspose.imaging.RasterImage image = (com.aspose.imaging.RasterImage) com.aspose.imaging.Image.load("image.png"); | |
// Flip the image horizontally | |
image.rotateFlip(com.aspose.imaging.RotateFlipType.RotateNoneFlipX); | |
// Save the flipped image | |
image.save("flipped-horizontal.png"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Load an image in an instance of Image | |
using (Image image = Image.Load("image.bmp")) | |
{ | |
// Rotate the image | |
image.RotateFlip(RotateFlipType.Rotate270FlipNone); | |
// Save image | |
image.Save("image-rotated.bmp"); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Load the input DWF file | |
Image image = Image.Load("DWFtoPDF.dwf"); | |
// Create an object of CadRasterizationOptions to set different properties | |
CadRasterizationOptions rasterizationOptions = new CadRasterizationOptions() | |
{ | |
PageWidth = 1600, | |
PageHeight = 1600, | |
ContentAsBitmap = true |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Load image | |
using (Image image = Image.Load("aspose-logo.png")) | |
{ | |
// Cache image data | |
if (!image.IsCached) | |
{ | |
image.CacheData(); | |
} | |
// Specify width and height |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Load an input JPG image | |
var bytes = File.ReadAllBytes(@"C:\Files\Sample_JPG.jpg"); | |
// Initialize an SVGDocument object | |
var document = new SVGDocument(); | |
// Create an image element | |
var img = (SVGImageElement)document.CreateElementNS("http://www.w3.org/2000/svg", "image"); | |
// Convert image to Base64 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Load the input Presentation | |
using var presentation = new Aspose.Slides.Presentation("sample.pptx"); | |
// Save the output PowerPoint XML Presentation format | |
presentation.Save(dataDir + "output.xml", Aspose.Slides.Export.SaveFormat.Xml); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
final com.groupdocs.redaction.Redactor redactor = new com.groupdocs.redaction.Redactor(dataDir + "SalesSeptember.xlsx"); | |
try | |
{ | |
com.groupdocs.redaction.redactions.CellFilter filter = new com.groupdocs.redaction.redactions.CellFilter(); | |
filter.setColumnIndex(1); | |
filter.setWorkSheetName("Customers"); | |
Pattern expression = Pattern.compile("^\\w+([-+.']\\w+)*@\\w+([-.]\\w+)*\\.\\w+([-.]\\w+)*$"); | |
com.groupdocs.redaction.RedactorChangeLog result = redactor.apply(new com.groupdocs.redaction.redactions.CellColumnRedaction(filter, expression, new com.groupdocs.redaction.redactions.ReplacementOptions("[customer email]"))); | |
if (result.getStatus() != com.groupdocs.redaction.RedactionStatus.Failed) | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Load the CDR sample file using Image.load function into CdrImage object | |
try (com.aspose.imaging.fileformats.cdr.CdrImage CdrtoPSDImage = (com.aspose.imaging.fileformats.cdr.CdrImage)com.aspose.imaging.Image.load("SampleCDRFile.cdr")) | |
{ | |
// Initialize PsdOptions object to set characteristics of output PSD file | |
com.aspose.imaging.ImageOptionsBase psdImportOptions = new com.aspose.imaging.imageoptions.PsdOptions(); | |
// For a multi-page document, by default all the pages are converted | |
psdImportOptions.setMultiPageOptions(new com.aspose.imaging.imageoptions.MultiPageOptions()); | |
// Use merger layer option to export multi-page CDR as a single layer |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Load DXF file | |
var converter = new com.groupdocs.conversion.Converter("sample.dxf"); | |
// Set conversion parameters for SVG format | |
var convertOptions = new com.groupdocs.conversion.filetypes.FileType().fromExtension("svg").getConvertOptions(); | |
// Convert DXF to SVG format | |
converter.convert("output.svg", convertOptions); |
NewerOlder