Draw this image as part of a collection of images

@param x The x location to draw the image at
@param y The y location to draw the image at
@param width The width to render the image at
@param height The height to render the image at
12967
public void drawEmbedded(float x,float y,float width,float height) {
		init();
		
		if (corners == null) {
		    GL.glTexCoord2f(textureOffsetX, textureOffsetY);
			GL.glVertex3f(x, y, 0);
			GL.glTexCoord2f(textureOffsetX, textureOffsetY + textureHeight);
			GL.glVertex3f(x, y + height, 0);
			GL.glTexCoord2f(textureOffsetX + textureWidth, textureOffsetY
					+ textureHeight);
			GL.glVertex3f(x + width, y + height, 0);
			GL.glTexCoord2f(textureOffsetX + textureWidth, textureOffsetY);
			GL.glVertex3f(x + width, y, 0);
		} else {
			corners[TOP_LEFT].bind();
		    GL.glTexCoord2f(textureOffsetX, textureOffsetY);
			GL.glVertex3f(x, y, 0);
			corners[BOTTOM_LEFT].bind();
			GL.glTexCoord2f(textureOffsetX, textureOffsetY + textureHeight);
			GL.glVertex3f(x, y + height, 0);
			corners[BOTTOM_RIGHT].bind();
			GL.glTexCoord2f(textureOffsetX + textureWidth, textureOffsetY
					+ textureHeight);
			GL.glVertex3f(x + width, y + height, 0);
			corners[TOP_RIGHT].bind();
			GL.glTexCoord2f(textureOffsetX + textureWidth, textureOffsetY);
			GL.glVertex3f(x + width, y, 0);
		}
	}
334786
public void paintEnabled(Graphics2D g, JComponent c, int width, int height) {
        paint(g, c, width, height, enabledBorder, enabledCorner, enabledInterior);
    }
1159537
public function draw(Dm_Image $image,$x=0,$y=0,$width=null,$height=null)
	{
		$srcImageResource = $image->getImageResource();
		if (is_null($width))  $width = $image->getWidth();
		if (is_null($height)) $height = $image->getHeight();
		return imagecopy(
			$this->getImageResource(),
			$srcImageResource,
			$x,
			$y,
			0,
			0,
			$width,
			$height
		);
	}
474312
@Override
    public void draw(@NonNull Canvas canvas) {
        if (mIcon == null && mPlainIcon == null) return;

        Rect viewBounds = getBounds();

        updatePaddingBounds(viewBounds);
        updateTextSize(viewBounds);
        offsetIcon(viewBounds);

        if (mRoundedCornerRy > -1 && mRoundedCornerRx > -1) {
            if (mDrawBackgroundContour) {
                float halfContourSize = mBackgroundContourWidth / 2f;
                RectF rectF = new RectF(
                        halfContourSize,
                        halfContourSize,
                        viewBounds.width() - halfContourSize,
                        viewBounds.height() - halfContourSize);
                canvas.drawRoundRect(
                        rectF,
                        mRoundedCornerRx,
                        mRoundedCornerRy,
                        mBackgroundBrush.getPaint());
                canvas.drawRoundRect(
                        rectF,
                        mRoundedCornerRx,
                        mRoundedCornerRy,
                        mBackgroundContourBrush.getPaint());
            } else {
                RectF rectF = new RectF(0, 0, viewBounds.width(), viewBounds.height());
                canvas.drawRoundRect(
                        rectF,
                        mRoundedCornerRx,
                        mRoundedCornerRy,
                        mBackgroundBrush.getPaint());
            }
        }

        try {
            mPath.close();
        } catch (Exception ignored) {
        }

        if (mDrawContour) {
            canvas.drawPath(mPath, mContourBrush.getPaint());
        }

        mIconBrush.getPaint().setColorFilter(mColorFilter == null ? mTintFilter : mColorFilter);

        canvas.drawPath(mPath, mIconBrush.getPaint());
    }
971753
private void paintForegroundEnabled(Graphics2D g, int width, int height) {
        Shape s = decodeArrowPath(width, height);

        g.setPaint(enabledColor);
        g.fill(s);

    }
758085
public void repaintRect (int x, int y, int width, int height)
    {
        // translate back into view coordinates
        x -= _vbounds.x;
        y -= _vbounds.y;
        repaint(x, y, width, height);
    }
763392
private void paintBorderEnabled(Graphics2D g, int width, int height) {
        Shape   s;
        s = shapeGenerator.createRoundRectangle(0, 0, width - 1, height - 1, CornerSize.BORDER);
        g.setPaint(borderColor);
        g.draw(s);
    }
1271569
function(width, height) {

    var _width = width;
    var _height = height;
    var _data = new Array(width * height);

    var _this = {};

    _this.setPixel = function(x, y, pixel) {
	_data[y * _width + x] = pixel;
    };

    _this.write = function(out) {

	//---------------------------------
	// GIF Signature

	out.writeString('GIF87a');

	//---------------------------------
	// Screen Descriptor

	out.writeShort(_width);
	out.writeShort(_height);

	out.writeByte(0x80); // 2bit
	out.writeByte(0);
	out.writeByte(0);

	//---------------------------------
	// Global Color Map

	// black
	out.writeByte(0x00);
	out.writeByte(0x00);
	out.writeByte(0x00);

	// white
	out.writeByte(0xff);
	out.writeByte(0xff);
	out.writeByte(0xff);

	//---------------------------------
	// Image Descriptor

	out.writeString(',');
	out.writeShort(0);
	out.writeShort(0);
	out.writeShort(_width);
	out.writeShort(_height);
	out.writeByte(0);

	//---------------------------------
	// Local Color Map

	//---------------------------------
	// Raster Data

	var lzwMinCodeSize = 2;
	var raster = getLZWRaster(lzwMinCodeSize);

	out.writeByte(lzwMinCodeSize);

	var offset = 0;

	while (raster.length - offset > 255) {
	    out.writeByte(255);
	    out.writeBytes(raster, offset, 255);
	    offset += 255;
	}

	out.writeByte(raster.length - offset);
	out.writeBytes(raster, offset, raster.length - offset);
	out.writeByte(0x00);

	//---------------------------------
	// GIF Terminator
	out.writeString(';');
    };

    var bitOutputStream = function(out) {

	var _out = out;
	var _bitLength = 0;
	var _bitBuffer = 0;

	var _this = {};

	_this.write = function(data, length) {

	    if ( (data >>> length) != 0) {
		throw new Error('length over');
	    }

	    while (_bitLength + length >= 8) {
		_out.writeByte(0xff & ( (data << _bitLength) | _bitBuffer) );
		length -= (8 - _bitLength);
		data >>>= (8 - _bitLength);
		_bitBuffer = 0;
		_bitLength = 0;
	    }

	    _bitBuffer = (data << _bitLength) | _bitBuffer;
	    _bitLength = _bitLength + length;
	};

	_this.flush = function() {
	    if (_bitLength > 0) {
		_out.writeByte(_bitBuffer);
	    }
	};

	return _this;
    };

    var getLZWRaster = function(lzwMinCodeSize) {

	var clearCode = 1 << lzwMinCodeSize;
	var endCode = (1 << lzwMinCodeSize) + 1;
	var bitLength = lzwMinCodeSize + 1;

	// Setup LZWTable
	var table = lzwTable();

	for (var i = 0; i < clearCode; i += 1) {
	    table.add(String.fromCharCode(i) );
	}
	table.add(String.fromCharCode(clearCode) );
	table.add(String.fromCharCode(endCode) );

	var byteOut = byteArrayOutputStream();
	var bitOut = bitOutputStream(byteOut);

	// clear code
	bitOut.write(clearCode, bitLength);

	var dataIndex = 0;

	var s = String.fromCharCode(_data[dataIndex]);
	dataIndex += 1;

	while (dataIndex < _data.length) {

	    var c = String.fromCharCode(_data[dataIndex]);
	    dataIndex += 1;

	    if (table.contains(s + c) ) {

		s = s + c;

	    } else {

		bitOut.write(table.indexOf(s), bitLength);

		if (table.size() < 0xfff) {

		    if (table.size() == (1 << bitLength) ) {
			bitLength += 1;
		    }

		    table.add(s + c);
		}

		s = c;
	    }
	}

	bitOut.write(table.indexOf(s), bitLength);

	// end code
	bitOut.write(endCode, bitLength);

	bitOut.flush();

	return byteOut.toByteArray();
    };

    var lzwTable = function() {

	var _map = {};
	var _size = 0;

	var _this = {};

	_this.add = function(key) {
	    if (_this.contains(key) ) {
		throw new Error('dup key:' + key);
	    }
	    _map[key] = _size;
	    _size += 1;
	};

	_this.size = function() {
	    return _size;
	};

	_this.indexOf = function(key) {
	    return _map[key];
	};

	_this.contains = function(key) {
	    return typeof _map[key] != 'undefined';
	};

	return _this;
    };

    return _this;
}
140481
public void setPixelSize(int width, int height) {
		layerHtmlContainer.setPixelSize(width, height);
		drawingArea.setWidth(width);
		drawingArea.setHeight(height);
		canvasPanel.setPixelSize(width, height);
		for (CanvasContainer container : worldCanvases) {
			container.setPixelSize(width, height);
		}
		super.setPixelSize(width, height);
	}
1025299
public void drawRectangle(int x, int y, int z, int width, int height, int color, int alpha)
	{
		drawRectangle(x, y, z, width, height, color, alpha, true);
	}
1298114
public void drawRect(float x1, float y1, float width, float height) {
		float lineWidth = getLineWidth();
		
		drawLine(x1,y1,x1+width,y1);
		drawLine(x1+width,y1,x1+width,y1+height);
		drawLine(x1+width,y1+height,x1,y1+height);
		drawLine(x1,y1+height,x1,y1);
	}
726202
public void setBounds(float x, float y, float width, float height) {
		setX(x);
		setY(y);
		setSize(width, height);
	}
840939
public Canvas draw (Drawable image, float x, float y) {
    return draw(image, x, y, image.width(), image.height());
  }
1073295
public Surface draw (Tile tile, float x, float y) {
    return draw(tile, x, y, tile.width(), tile.height());
  }
197843
@Override
	public void initialize(int width, int height) {
		// see if it has already been initialized
		if( bottomWidth == width && bottomHeight == height )
			return;

		this.bottomWidth = width;
		this.bottomHeight = height;
		layers = imageType.createArray(getNumLayers());
		double scaleFactor = getScale(0);

		if (scaleFactor == 1) {
			if (!saveOriginalReference) {
				layers[0] = imageType.createImage(bottomWidth, bottomHeight);
			}
		} else {
			layers[0] = imageType.createImage((int)Math.ceil(bottomWidth / scaleFactor), (int)Math.ceil(bottomHeight / scaleFactor));
		}

		for (int i = 1; i < layers.length; i++) {
			scaleFactor = getScale(i);
			layers[i] = imageType.createImage((int)Math.ceil(bottomWidth / scaleFactor), (int)Math.ceil(bottomHeight / scaleFactor));
		}
	}
254136
public void drawImage(Image image, float x, float y, Color col) {
		predraw();
		image.draw(x, y, col);
		currentColor.bind();
		postdraw();
	}
1121167
private void paintBackgroundSolid(Graphics2D g, JComponent c, int x, int y, int width, int height) {
        Color color = c.getBackground();

        if (type == CommonControlState.DISABLED) {
            color = new Color(color.getRed(), color.getGreen(), color.getBlue(), 0x80);
        }

        Shape s = shapeGenerator.createRoundRectangle(x-2, y-2, width+4, height+4, CornerSize.BORDER);
        g.setPaint(color);
        g.fill(s);
        if (isPaintLineSeperators(c)) {
            paintLineSeparator(g, c, width, height);
        }
        
    }