This section covers the Java samples included with RasterMaster Java. They are used to manipulate an image in many ways, such as altering its alter viewable size, changing its orientation, correcting its imperfections, modifying its size and resolution, converting it to another format, and adding text and graphic annotations.

If you do not find the kind of sample that you are looking for, please open a support ticket to request a specific sample. We are dedicated to helping our customers succeed and we are constantly enhancing our products based on feedback from customers like you.

You can find the samples in the [RM Java install dir]\sample-code\com\snowbound\samples\.

Run RasterMaster samples in your IDE

To run one of the demos in your development environment, perform the following:

Note: These instructions are based on Eclipse.

  1. Extract all of the package files to the workspace.
  2. Be sure to download the license .zip and extract the license. Place the license in the [FilePath]\[MainRMFolder]\lib directory.
  3. Open Eclipse and open the prepared workspace.
  4. Go to File > New Project > Java Project.
  5. Name the project “sample-code” and click Finish.
  6. Next, right-click the project and select Build Path-> Configure Build Path… from the drop down menu.
  7. In the Libraries Tab click Add External JARs… and include all the files in the [FilePath]\[MainRMFolder]\lib directory.
  8. Click Apply and Close.
  9. Select the sample (e.g., SingleConversion.Java) in the convert package.
  10. Adjust the inputFile variable to a full filepath for your test file.
  11. Finally, run the project.

Run Samples from the Command Prompt

To run a sample from the command prompt:

  1. Make sure that that OracleJDK or OpenJDK (Java Development Kit) is installed on your system. Make sure that you have added SnowboundLicense.jar to RasterMaster /lib folder

    In the following example, the JDK is installed at this location (Windows):

    C:\Program Files\Java\jdk-11.0.2\bin
    
  2. Make sure that the code sample you want to run is in a directory name that matches the package name. In this example, RasterMaster Java was installed on c:\me. For example, the SingleConversion sample is in this directory:

    C:\me\com\snowbound\samples\convert
    
  3. Follow the example below to change directory to be in the top-level directory, to the directory above com.

    C:\> cd me
    C:\me>
    
  4. Use the example below to compile the sample from the command line by running javac from the JDK.

    C:\me> "C:\Program Files\Java\jdk-11.0.2\bin\javac" -classpath
    ".;..\lib\*;.\com\snowbound\snowcommon.jar;C:\Program Files\Java\jdk-
    11.0.2\bin” .\com\snowbound\samples\convert\SingleConversion.java
    
  5. Finally, run the sample from the command line, again from the top-level directory:

    C:\me> java -cp ".;..\lib\*;.\com\snowbound\snowcommon.jar" com.snowbound.samples.convert.SingleConversion
    

Java samples