/** * Load image from InputStream as bitmap image, or SVG image conversion to bitmap image. */ private static SwingUniversalImage loadImage( InputStream in, String filename ) { if ( !SvgSupport.isSvgName( filename ) ) { // bitmap image try { return new SwingUniversalImageBitmap( ImageIO.read( in ) ); } catch ( IOException e ) { throw new RuntimeException( e ); } } else { // svg image - need to convert to bitmap try { return new SwingUniversalImageSvg( SvgSupport.loadSvgImage( in ) ); } catch ( Exception ex ) { throw new RuntimeException( ex ); } } } }
in = super.getResourceAsStream( SvgSupport.toSvgName( resource ) ); SvgImage svg = SvgSupport.loadSvgImage( in ); SwtUniversalImage image = new SwtUniversalImageSvg( svg );
SvgImage svg = SvgSupport.loadSvgImage( inputStream ); image = new SwingUniversalImageSvg( svg ); } catch ( Exception ex ) {
/** * Load image from InputStream as bitmap image, or SVG image conversion to bitmap image. */ private static SwtUniversalImage loadImage( Display display, InputStream in, String filename ) { if ( !SvgSupport.isSvgName( filename ) ) { // bitmap image return new SwtUniversalImageBitmap( new Image( display, in ) ); } else { // svg image - need to convert to bitmap try { return new SwtUniversalImageSvg( SvgSupport.loadSvgImage( in ) ); } catch ( Exception ex ) { throw new RuntimeException( ex ); } } } }
SvgImage svg = SvgSupport.loadSvgImage( inputStream ); image = new SwingUniversalImageSvg( svg ); } catch ( Exception ex ) {
SvgImage svg = SvgSupport.loadSvgImage( inputStream ); image = new SwingUniversalImageSvg( svg ); } finally {
SvgImage svg = SvgSupport.loadSvgImage( in ); SwtUniversalImage image = new SwtUniversalImageSvg( svg );