MyDigitalLife

goedegep.resources

Pictures may be used by different components of the application. Therefore they are available via a separate project.

enum ImageResource

This enum defines and provides the available images.

An image is defined as follows

  • information on the picture files
    Often an image is provided in more than one size, therefore this is a list with information per file:

    • the file name
    • the width of the image in pixels
    • the height of the image in pixels
  • description
    A short description of the image, e.g. ‘a person canoeing’.
  • credits
    Information about the source of the picture.

There are methods to get the largest image available, or to get an images of a specific size. In the latter case the best fitting image is resized to the requested size.
The requested size can be specified as width and height, or via one of the constants defined by the ImageSize enum.

There are also methods to get the filename or URL for an image of a specific size. This can e.g. be used if you generate an HTML file which contains images.

The images are loaded when first requested and are kept in memory from then on.

enum ImageSize

This enum provides constants for some often used image sizes.

Source code

The source code of this project is available at goedegep.resources at GitHub.
Examples of using this library are available at goedegep.demo.resources at GitHub.

The following is a screenshot of this demo application.