Skip to content

Commit 715cee4

Browse files
author
Evgeniy Sidenko
committed
Updated upto 24.12
1 parent 29f7926 commit 715cee4

File tree

3 files changed

+50
-3
lines changed

3 files changed

+50
-3
lines changed

Examples/pom.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<modelVersion>4.0.0</modelVersion>
44
<groupId>com.aspose</groupId>
55
<artifactId>imaging-java-examples</artifactId>
6-
<version>24.11</version>
6+
<version>24.12</version>
77
<packaging>jar</packaging>
88
<properties>
99
<maven.compiler.source>1.8</maven.compiler.source>
@@ -15,14 +15,14 @@
1515
<dependency>
1616
<groupId>com.aspose</groupId>
1717
<artifactId>aspose-imaging</artifactId>
18-
<version>24.11</version>
18+
<version>24.12</version>
1919
<classifier>jdk16</classifier>
2020
<type>jar</type>
2121
</dependency>
2222
<dependency>
2323
<groupId>com.aspose</groupId>
2424
<artifactId>aspose-imaging</artifactId>
25-
<version>24.11</version>
25+
<version>24.12</version>
2626
<classifier>javadoc</classifier>
2727
<type>jar</type>
2828
</dependency>
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
package com.aspose.imaging.examples.ModifyingImages;
2+
3+
import com.aspose.imaging.*;
4+
import com.aspose.imaging.examples.Logger;
5+
import com.aspose.imaging.examples.Utils;
6+
import com.aspose.imaging.fileformats.opendocument.OdImage;
7+
import com.aspose.imaging.imageoptions.PngOptions;
8+
import com.aspose.imaging.imageoptions.VectorRasterizationOptions;
9+
10+
public class UnifyUsageOfCommonOperations
11+
{
12+
public static void main(String[] args)
13+
{
14+
Logger.startExample();
15+
// The path to the documents' directory.
16+
String dataDir = Utils.getSharedDataDir() + "CDR/";
17+
String fileName = "test.cdr";
18+
String inputFileName = dataDir + fileName;
19+
String outputFileNamePng = Utils.getOutDir() + "output.png";
20+
21+
try (Image image = Image.load(inputFileName))
22+
{
23+
if (image instanceof OdImage)
24+
{
25+
image.crop(new Rectangle(92, 179, 260, 197));
26+
}
27+
else
28+
{
29+
image.crop(new Rectangle(88, 171, 250, 190));
30+
}
31+
32+
image.save(outputFileNamePng, new PngOptions()
33+
{{
34+
setVectorRasterizationOptions(new VectorRasterizationOptions()
35+
{{
36+
setPageSize(Size.to_SizeF(image.getSize()));
37+
setTextRenderingHint(TextRenderingHint.SingleBitPerPixel);
38+
setSmoothingMode(SmoothingMode.None);
39+
40+
}});
41+
}});
42+
}
43+
Utils.deleteFile(outputFileNamePng);
44+
Logger.endExample();
45+
}
46+
}

Examples/src/main/java/com/aspose/imaging/examples/RunExamples.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,7 @@ public static void main(String[] args) throws IOException, InterruptedException,
116116
//// =====================================================
117117

118118
Logger.println("Running modifying and converting images tests:");
119+
UnifyUsageOfCommonOperations.main(args);
119120
LoadAvif.main(args);
120121
SupportDicomYBR422.main(args);
121122
RemoveAndSaveWithMetadata.main(args);

0 commit comments

Comments
 (0)