Factory method for create a new {@link Image}.

@param id
the id
@param imageResource
the IResource object
@return the new {@link Image}.
162148
public static Image newImage(final String id, final IResource imageResource)
	{
		final Image image = new Image(id, imageResource);
		image.setOutputMarkupId(true);
		return image;
	}
907369
static InputSource createInputSource(Identifier id, Input input) {
    InputSource inputSource = createInputSource(input);
    if (id instanceof ExternalIdentifier)
      inputSource.setPublicId(((ExternalIdentifier)id).getPublicId());
    if (inputSource.getSystemId() == null)
      inputSource.setSystemId(getSystemId(id));
    return inputSource;
  }
762505
public void create(@Nonnull QEmuImageFormat format, @Nonnegative long size) throws IOException {
        ProcessBuilder builder = new ProcessBuilder("qemu-img", "create", "-f", format.name(), file.getAbsolutePath(), String.valueOf(size));
        Process process = builder.start();
        ByteStreams.copy(process.getInputStream(), System.err);
    }
456181
void createImage( String imageId ) throws TargetException {

		// If there is no Dockerfile, this method will do nothing
		File targetDirectory = this.parameters.getTargetPropertiesDirectory();
		String dockerFilePath = this.parameters.getTargetProperties().get( GENERATE_IMAGE_FROM );
		if( ! Utils.isEmptyOrWhitespaces( dockerFilePath ) && targetDirectory != null ) {

			this.logger.fine( "Trying to create image " + imageId + " from a Dockerfile." );
			File dockerFile = new File( targetDirectory, dockerFilePath );
			if( ! dockerFile.exists())
				throw new TargetException( "No Dockerfile was found at " + dockerFile );

			// Start the build.
			// This will block the current thread until the creation is complete.
			String builtImageId;
			this.logger.fine( "Asking Docker to build the image from our Dockerfile." );
			try {
				builtImageId = this.dockerClient
					.buildImageCmd( dockerFile )
					.withTags( Sets.newHashSet( imageId ))
					.withPull( true )
					.exec( new RoboconfBuildImageResultCallback())
					.awaitImageId();

			} catch( Exception e ) {
				Utils.logException( this.logger, e );
				throw new TargetException( e );
			}

			// No need to store the real image ID... Docker has it.
			// Besides, we search images by both IDs and tags.
			// Anyway, we can log the information.
			this.logger.fine( "Image '" + builtImageId + "' was succesfully generated by Roboconf." );
		}
	}
337416
public BufferedImage createImage (int width, int height, int transparency)
    {
        return _icreator.createImage(width, height, transparency);
    }
774373
public Image createImage(String src, String alt) {
    return this.add(new Image(src, alt));
  }
262593
public BufferedImage createImage() {

		BufferedImage image = null;
		Graphics2D graphics = null;

		for (int layer = 0; layer < 4; layer++) {

			BufferedImage layerImage = layeredImage[layer];

			if (layerImage != null) {

				if (image == null) {
					image = layerImage;
					graphics = layeredGraphics[layer];
				} else {
					graphics.drawImage(layerImage, 0, 0, null);
					layeredGraphics[layer].dispose();
					layerImage.flush();
				}

				layeredImage[layer] = null;
				layeredGraphics[layer] = null;
			}
		}

		if (graphics != null) {
			graphics.dispose();
		}

		return image;
	}
956626
public void setResourceAwsEc2InstanceImageId(java.util.Collection<StringFilter> resourceAwsEc2InstanceImageId) {
        if (resourceAwsEc2InstanceImageId == null) {
            this.resourceAwsEc2InstanceImageId = null;
            return;
        }

        this.resourceAwsEc2InstanceImageId = new java.util.ArrayList<StringFilter>(resourceAwsEc2InstanceImageId);
    }
771763
public function createImageResource($keepHandleAlive = false): ImageResource {
		$resource = IoUtils::imageCreateFromPng($this->filePath);
		
		imagealphablending($resource, false);
		
		return new ImageResource($resource, $keepHandleAlive);
	}
1136689
private BufferedImage createImage(final int WIDTH, final int HEIGHT, final int TRANSPARENCY) {
        final GraphicsConfiguration GFX_CONF = GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice().getDefaultConfiguration();
        if (WIDTH <= 0 || HEIGHT <= 0) {
            return GFX_CONF.createCompatibleImage(1, 1, TRANSPARENCY);
        }
        final BufferedImage IMAGE = GFX_CONF.createCompatibleImage(WIDTH, HEIGHT, TRANSPARENCY);
        return IMAGE;
    }
1250774
public ImageDescriptor getImageDescriptor(String id) {
        ImageDescriptor imageDescriptor = imageDescriptors.get(id);
        if (imageDescriptor == null) {
            String pluginId = getDefault().getBundle().getSymbolicName();
            imageDescriptor = AbstractUIPlugin.imageDescriptorFromPlugin(pluginId, ICON_PATH + id);
            imageDescriptors.put(id, imageDescriptor);
        }
        return imageDescriptor;
    }
934229
public InputStream createResourceAsStream(GeneratorContext context) {
		
		ServletContext servletContext = context.getConfig().getContext();
		return servletContext.getResourceAsStream("/img/"+context.getPath());
	}
214865
private ImageIcon createIcon(String resourcePath) {
		if (getView() == null) {
			return null;
		}
		return new ImageIcon(ExtensionScript.class.getResource(resourcePath));
	}
950518
public void setImage(Resource resource)
    {
        ImageIcon image = null;
        if (resource != null && resource.exists())
        {
            try
            {
                image = new ImageIcon(resource.getURL());
            }
            catch (IOException e)
            {
                logger.warn("Error reading resource: " + resource);
                throw new RuntimeException("Error reading resource " + resource, e);
            }
        }
        setImage(image);
    }
1145898
def build_from_id(id)
      @image = ::Docker::Image.get(id)
      add_repository_tag
    rescue ::Docker::Error::NotFoundError
      @image = ::Docker::Image.create('fromImage' => id)
      add_repository_tag
    rescue ::Docker::Error::DockerError => e
      DockerExceptionParser.new(e)
    end
916576
public static Image getImageFromResources(Class<?> clazz, String name, Toolkit toolkit) throws IOException {
		byte[] imageData;
		InputStream in = clazz.getResourceAsStream(name);
		if(in==null) throw new IOException("Unable to find resource: "+name);
		try {
			imageData = IoUtils.readFully(in);
		} finally {
			in.close();
		}
		return toolkit.createImage(imageData);
	}
1111742
public void setImageResource(int imageResource, int imageWidth, int imageHeight) {
        bitmap = extractBitmapFromDrawable(getResources().getDrawable(imageResource));
        bitmapSrcRect = bitmapRect(bitmap);

        this.imageWidth = imageWidth;
        this.imageHeight = imageHeight;

        rebuildFitter();
    }