Skip to content

Commit

Permalink
Updated upto 24.12
Browse files Browse the repository at this point in the history
  • Loading branch information
Evgeniy Sidenko committed Dec 4, 2024
1 parent 29f7926 commit 715cee4
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Examples/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.aspose</groupId>
<artifactId>imaging-java-examples</artifactId>
<version>24.11</version>
<version>24.12</version>
<packaging>jar</packaging>
<properties>
<maven.compiler.source>1.8</maven.compiler.source>
Expand All @@ -15,14 +15,14 @@
<dependency>
<groupId>com.aspose</groupId>
<artifactId>aspose-imaging</artifactId>
<version>24.11</version>
<version>24.12</version>
<classifier>jdk16</classifier>
<type>jar</type>
</dependency>
<dependency>
<groupId>com.aspose</groupId>
<artifactId>aspose-imaging</artifactId>
<version>24.11</version>
<version>24.12</version>
<classifier>javadoc</classifier>
<type>jar</type>
</dependency>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
package com.aspose.imaging.examples.ModifyingImages;

import com.aspose.imaging.*;
import com.aspose.imaging.examples.Logger;
import com.aspose.imaging.examples.Utils;
import com.aspose.imaging.fileformats.opendocument.OdImage;
import com.aspose.imaging.imageoptions.PngOptions;
import com.aspose.imaging.imageoptions.VectorRasterizationOptions;

public class UnifyUsageOfCommonOperations
{
public static void main(String[] args)
{
Logger.startExample();
// The path to the documents' directory.
String dataDir = Utils.getSharedDataDir() + "CDR/";
String fileName = "test.cdr";
String inputFileName = dataDir + fileName;
String outputFileNamePng = Utils.getOutDir() + "output.png";

try (Image image = Image.load(inputFileName))
{
if (image instanceof OdImage)
{
image.crop(new Rectangle(92, 179, 260, 197));
}
else
{
image.crop(new Rectangle(88, 171, 250, 190));
}

image.save(outputFileNamePng, new PngOptions()
{{
setVectorRasterizationOptions(new VectorRasterizationOptions()
{{
setPageSize(Size.to_SizeF(image.getSize()));
setTextRenderingHint(TextRenderingHint.SingleBitPerPixel);
setSmoothingMode(SmoothingMode.None);

}});
}});
}
Utils.deleteFile(outputFileNamePng);
Logger.endExample();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ public static void main(String[] args) throws IOException, InterruptedException,
//// =====================================================

Logger.println("Running modifying and converting images tests:");
UnifyUsageOfCommonOperations.main(args);
LoadAvif.main(args);
SupportDicomYBR422.main(args);
RemoveAndSaveWithMetadata.main(args);
Expand Down

0 comments on commit 715cee4

Please sign in to comment.