Contact Us

Alagad is located in Chapel Hill, North Carolina in the Research Triangle Park area.

Phone: 888-ALAGAD4
Fax: 888-248-7836
Email: please use our contact form

208 Calderon Dr.
Chapel Hill, NC 27516 USA

Request an Alagad proposal
Request a TaskForce consultation

Image Component Methods

The Alagad Image Component provides nearly 100 methods for working with and manipulating images. The following table lists many of these methods. For a more complete list and detailed information on these methods see the documentation.

Methods for Working with Images and Image Files
createImage() Creates a new image to edit.
readFromBase64() Reads image data which has been base64 encoded.
readFromBinary() Reads raw binary image data.
readImageFromURL() Reads an image from a URL.
readImage() Reads an image from disk.
writeToBase64() Encodes image data to base 64.
writeToBinary() Converts the image to raw binary data.
writeToBrowser() Outputs image data directly to the browser.
writeImage() Writes an image to disk.
getReadableFormats() Returns a list of readable image formats.
getWritableFormats() Returns a list of writable image formats.

Image Size Methods
crop() Crops the image to a new width and height.
scaleHeight() Scales the image to a specific height.
scalePercent() Scales the image by a percentage.
scalePixels() Scales the image to a specific pixel size.
scaleToBox() Scales the image to fit within a specific width and height.
scaleToFit() Scales the image to fit within a specific size.
scaleWidth() Scales the image to a specific width.
setImageSize() Changes the canvas size without rescaling the image.
trimEdges() Trims pixels of the same color from image edges.
getHeight() Returns the image height.
getWidth() Returns the image width.

Manipulating Image Data
adjustLevels() Adjusts the image color levels.
blur() Blurs the image.
clearImage() Clears the entire image.
clearRectangle() Clears a rectangular area within the image.
copyRectangleTo() Copies a rectangular area in the image to another area in the image.
darken() Darkens the image.
emboss() Embosses the image.
findEdges() Finds high contrast edges within the image.
flipHorizontal() Flips the image along it's horizontal axis.
flipVertical() Flips the image along it's vertical axis.
getImageMode() Returns the image type.
grayScale() Converts the image to grayscale.
lighten() Lightens the image.
negate() Negates the image.
rotate() Rotates the image.
setImageMode() Sets the image type.
sharpen() Sharpens the image.

Drawing on Images
drawArc() Draws an arc shape into the image.
drawImage() Draws another image into the image.
drawLine() Draws a line into the image.
drawOval() Draws an oval or circle into the image.
drawRectangle() Draws a rectangle or square into the image.
drawRoundRectangle() Draws a rectangle or square with rounded corners into the image.

Drawing Polygons on Images
addPolygonPoint() Add a point to a polygon object.
createPolygon() Creates a polygon object.
drawPolygon() Draws a polygon object into the image.

Drawing Paths on Images
addPathBezierCurve() Add a bezier curve to a path object.
addPathJump() Adds a point to a path without drawing a line.
addPathLine() Adds a streight line to a path object.
addPathQuadraticCurve() Add a quadratic curve to a path object.
createPath() Creates a path object.
drawPath() Draws a path object.

Drawing Simple Text on Images
drawSimpleString() Draws a simple string into the image.
getSimpleStringMetrics() Returns a structure of size information for a simple string.

Drawing Advanced Text on Images
createString() Creates an Advanced String Object.
drawString() Draws an Advanced String Object into the image.
getStringMetrics() Returns a structure of size information for an Advanced String Object.
setStringBackground() Sets the background color for an Advanced String Object.
setStringDirection() Sets the run direction for an Advanced String Object.
setStringFamily() Sets the font family for an Advanced String Object.
setStringFont() Sets the font for an Advanced String Object.
setStringForeground() Sets the foreground color for an Advanced String Object.
setStringSize() Sets the font size for an Advanced String Object.
setStringStrikeThrough() Turns strikethough on or off for an Advanced String Object.
setStringUnderline() Turns underline on or off for an Advanced String Object.
setStringPosture() Sets the font posture or angle for an Advanced String Object.
setStringWeight() Sets the font weight for an Advanced String Object.
setStringWidth() Sets the font width for an Advanced String Object.

Fonts
getSystemFonts() Returns an array of fonts available for use on the system.
loadSystemFont() Loads a system font and returns a Font Object.
loadTTFFile() Loads a True Type Font (TTF) file and returns a Font Object.

Component Properties
reset() Resets all of the component properties.
resetAntialias() Resets the antialiasing property.
resetBackgroundColor() Resets the background color property.
resetComposite() Resets the composite property.
resetFill() Resets the fill property.
resetRotation() Resets the rotation property.
resetShear() Resets the shear property.
resetStroke() Resets the stroke property.
resetTransparency() Resets the background color property.
setAntialias() Sets the antialiasing property.
setBackgroundColor() Sets the image's background color.
setComposite() Sets the method used for alpha channel compositing.
setFill() Sets the fill style for shapes drawn into the image.
setRotation() Sets the rotation settings for items drawn into the image.
setShear() Sets the shear settings for items drawn into the image.
setStroke() Sets the stroke settings for items drawn into the image.
setTransparency() Sets the alpha transparency of items drawn into the image.

Colors and Fills
createColor() Creates and returns an ARGB color for use with strokes and fills.
createGradient() Creates a gradient for filling shapes.
createTexture() Creates a texture based on another image for filling shapes.
getColorByName() Creates and returns a color by color name.
getColorFromPixel() Returns a color based on a specific pixel.
getColorList() A list of predefined color names.

Extensibility
getBufferedImage() Returns the underlying BufferedImage object.
setBufferedImage() Sets the underlying BufferedImage object.