Draws the image in the {@link Context2D}.

@param context {@link Context2D}
503294
public void drawImage(final Context2D context)
    {
        if (isLoaded())
        {
            doUpdateCheck();

            if (context.isSelection())
            {
                if (ImageSelectionMode.SELECT_BOUNDS == m_image.getImageSelectionMode())
                {
                    context.setFillColor(m_image.getColorKey());

                    context.beginPath();

                    context.rect(0, 0, m_dest_wide, m_dest_high);

                    context.fill();

                    context.closePath();
                }
                else
                {
                    context.drawImage(m_selectImage.getElement(), 0, 0);
                }
            }
            else
            {
                if (m_fastout)
                {
                    context.drawImage(m_jsimg, m_clip_xpos, m_clip_ypos, m_clip_wide, m_clip_high, 0, 0, m_dest_wide, m_dest_high);
                }
                else
                {
                    context.drawImage(m_filterImage.getElement(), 0, 0);
                }
            }
        }
    }
148033
protected void configureContext(Context context) {
		this.contextLifecycleListeners.forEach(context::addLifecycleListener);
		new DisableReferenceClearingContextCustomizer().customize(context);
		this.tomcatContextCustomizers
				.forEach((customizer) -> customizer.customize(context));
	}
890443
function recolorImageWithCanvasContext(context, img, colorFunc) {
  if (!defined(context)) {
    throw new DeveloperError("No context for image recoloring.");
  }

  // Copy the image contents to the canvas
  context.clearRect(0, 0, context.canvas.width, context.canvas.height);
  context.drawImage(img, 0, 0);
  var image = context.getImageData(
    0,
    0,
    context.canvas.width,
    context.canvas.height
  );
  image = ImageryProviderHooks.recolorImage(image, colorFunc);
  return image;
}
208015
function drawRadialPlate(context, options) {
    let pxRatio = SmartCanvas.pixelRatio;
    let d0 = options.borderShadowWidth * pxRatio;
    let r0 = context.max - d0 - (options.borderOuterWidth * pxRatio) / 2;
    let r1 = r0 - (options.borderOuterWidth * pxRatio) / 2 -
        (options.borderMiddleWidth * pxRatio) / 2 + 0.5;
    let r2 = r1 - (options.borderMiddleWidth * pxRatio) / 2 -
        (options.borderInnerWidth * pxRatio) / 2 + 0.5;
    let r3 = maxRadialRadius(context, options);
    let grad;
    let shadowDrawn = false;

    context.save();

    if (options.borderOuterWidth) {
        shadowDrawn = drawings.drawShadow(context, options, shadowDrawn);
        drawRadialBorder(r0,
            options.borderOuterWidth * pxRatio,
            context,
            options.colorBorderOuter,
            options.colorBorderOuterEnd);
    }

    if (options.borderMiddleWidth) {
        shadowDrawn = drawings.drawShadow(context, options, shadowDrawn);
        drawRadialBorder(r1,
            options.borderMiddleWidth * pxRatio,
            context,
            options.colorBorderMiddle,
            options.colorBorderMiddleEnd);
    }

    if (options.borderInnerWidth) {
        shadowDrawn = drawings.drawShadow(context, options, shadowDrawn);
        drawRadialBorder(r2,
            options.borderInnerWidth * pxRatio,
            context,
            options.colorBorderInner,
            options.colorBorderInnerEnd);
    }

    drawings.drawShadow(context, options, shadowDrawn);

    context.beginPath();
    //noinspection JSUnresolvedFunction
    context.arc(0, 0, abs(r3), 0, PI * 2, true);

    if (options.colorPlateEnd) {
        grad = context.createRadialGradient(0, 0, r3 / 2, 0, 0, r3);
        grad.addColorStop(0, options.colorPlate);
        grad.addColorStop(1, options.colorPlateEnd);
    }

    else  {
        grad = options.colorPlate;
    }

    context.fillStyle = grad;

    context.fill();
    context.closePath();

    context.restore();
}
1173708
function(image, position, options) {
        this._drawOnCanvasContext(options, function(g) {
            this._setImageStyles(g, options);
            g.drawImage(image, position[0], position[1]);
            return true;
        });
    }
1260449
@Override
    public void drawWithTransforms(final Context2D context, final double alpha, final BoundingBox bounds)
    {
        if ((context.isSelection()) && (false == isListening()))
        {
            return;
        }
        if (context.isDrag() || isVisible())
        {
            context.saveContainer();

            final Transform xfrm = getPossibleNodeTransform();

            if (null != xfrm)
            {
                context.transform(xfrm);
            }
            drawWithoutTransforms(context, alpha, bounds);

            context.restoreContainer();
        }
    }
254136
public void drawImage(Image image, float x, float y, Color col) {
		predraw();
		image.draw(x, y, col);
		currentColor.bind();
		postdraw();
	}
1035835
public void generate(Context context) {
        Appendable target = context.getTarget();

        for (ProcTemplateElement element : elements) {
            try {
                target.append(element.generate(context));
            } catch (IOException e) {
                // Nothing! Because StringBuilder doesn't catch IOException
            }
        }
    }
155835
public static void result(final RequestContext context) {
        final HttpServletResponse response = context.getResponse();
        if (response.isCommitted()) { // Response sends redirect or error
            return;
        }

        AbstractResponseRenderer renderer = context.getRenderer();
        if (null == renderer) {
            renderer = new Http404Renderer();
        }
        renderer.render(context);
    }
1152567
protected void renderDebugBoundingBoxOuter(Graphics2D context) {
		java.awt.Color previousColor = context.getColor();
		context.setColor(java.awt.Color.RED);
		Rectangle2D bb = getBoundingBox();
		bb.setRect(bb.getX()-1, bb.getY()-1, bb.getWidth()+2, bb.getHeight()+2);
		context.draw(bb);
		context.setColor(previousColor);
	}
174131
@Override
	public InputStream createResourceAsStream(GeneratorContext context) {

		String path = context.getPath();
		InputStream is = null;
		if (FileNameUtils.hasImageExtension(path)) {
			try {
				is = context.getResourceReaderHandler().getResourceAsStream(path, false);
			} catch (ResourceNotFoundException e) {
				// Nothing to do
			}
		}

		return is;
	}
7233
public void paint(Paintable paintable, Object group, MapContext context) {
		RasterTile tile = (RasterTile) paintable;
		context.getRasterContext().drawImage(tile.getStore().getLayer(), 
				tile.getCode().toString(), tile.getUrl(), tile.getBounds(), new PictureStyle(1.0));
	}
598317
public static ImagePipelineConfig getOkHttpImagePipelineConfig(Context context) {
    if (sOkHttpImagePipelineConfig == null) {
      OkHttpClient okHttpClient = new OkHttpClient.Builder()
          .addNetworkInterceptor(new StethoInterceptor())
          .build();
      ImagePipelineConfig.Builder configBuilder =
        OkHttpImagePipelineConfigFactory.newBuilder(context, okHttpClient);
      configureCaches(configBuilder, context);
      configureLoggingListeners(configBuilder);
      sOkHttpImagePipelineConfig = configBuilder.build();
    }
    return sOkHttpImagePipelineConfig;
  }
497707
@Override
    protected void drawBase (Graphics2D gfx, int x, int y)
    {
        if (_active) {
            // render the sausage
            super.drawBase(gfx, x, y);

        } else {
            // render the circle
            gfx.fillOval(x, y, closedBounds.width - 1, closedBounds.height - 1);
        }
    }
877176
protected final void setContext(@NonNull final Context context) {
        Condition.INSTANCE.ensureNotNull(context, "The context may not be null");
        this.context = context;
    }
499702
public void paint (Graphics2D gfx, int x, int y)
    {
        gfx.drawImage(_image, x, y, null);
    }
951036
@Override
	public void paint(final RenderContext renderContext) {
		if (renderContext instanceof WebXmlRenderContext) {
			PageContentHelper.addAllHeadlines(((WebXmlRenderContext) renderContext).getWriter(),
					getUI().getHeaders());
		}

		getBackingComponent().paint(renderContext);
	}