[OpenJDK 2D-Dev] [9] Review request for 8163854 Add ToolkitImage.getImage() method which loads an image with schema variant
    Alexander Scherbatiy 
    alexandr.scherbatiy at oracle.com
       
    Wed Aug 24 16:36:14 UTC 2016
    
    
  
Hello,
Could you review the fix:
   bug: https://bugs.openjdk.java.net/browse/JDK-8163854
   webrev: http://cr.openjdk.java.net/~alexsch/8163854/webrev.00
   The public API which allows to load an image with resolution variants 
based on the provided media resolution naming scheme is added:
   - Toolkit.MediaResolutionNamingScheme class
   - Toolkit.getImageUsingNamingSchemes(String fileName, 
MediaResolutionNamingScheme... namingSchemes)
   A simple example for images which use naming scheme @150pct for scale 
1.5 and @2x for scale 2 is:
     image_name.ext
     image_name at 150pct.ext
     image_name at 2x.ext
     Toolkit toolkit = Toolkit.getDefaultToolkit();
     Image image = toolkit.getImageUsingNamingSchemes(fileName,
             new Toolkit.MediaResolutionNamingScheme(“@150pct”, 1.5f),
             new Toolkit.MediaResolutionNamingScheme(“@2x", 2f)
     );
   Thanks,
   Alexandr.
    
    
More information about the 2d-dev
mailing list