public class BBXImage extends Object
BBXImage
utility provides an object-oriented way to manipulate an image in a variety of ways.
Obtain the BBXImage
from a BBjImage, from a file on the server, or from a URL such as an HTTP URL that retrieves an image from the Internet.
You can then modify the BBXImage
in a number of ways and affect its scale (as a percentage or proportional to width or height),
rotation, and opacity. It is also possible to add borders, drop shadows, reflections, and even crop the corners of the image.
After manipulating the BBXImage
, the class offers methods to save it out as a PNG or JPG file with a configurable compression percentage.
In BBj 15.0 and higher, the BBXImage
Utility provides filtering methods to
In BBj 16.0 and higher, the BBXImage
Utility provides methods to
In BBj 17.0 and higher, the BBXImage
Utility provides a method to
In BBj 18.0 and higher, the BBXImage
Utility provides methods to
In BBj 19.0 and higher, the BBXImage
Utility provides methods to
Here's a quick rundown of what you need to do to use it in your program:
<bbjhome>/utils/
directory is in your prefix. The BBXImage.bbj
source program is located there,
so if that directory is in your prefix then the utility will be accessible in your applications.USE
statement for the utility so that your application can reference the custom class and provide code completion for its methods.
The USE
statement should look like this:USE ::BBXImage.bbj::BBXImage
BBXImage
class in your application, the process goes something like this:
BBXImage
object from something like a BBjImage, a Java Image or ImageIcon, URL, etc:
declare BBXImage xImage!
xImage! = new BBXImage(mySource!)
xImage!.scaleProportionally(maxWidth, maxHeight)
myImageCtrl!.setImage(xImage!.getBBjImage())
xImage!.saveAsJPG(fullPathToJpgFile$, compressionLevel75)
THROW
n Error Codes:
313
: Invalid color specified. The specified string for a hex color description was invalid. It should in a format like #fafbfc
or #f0c
.400
: Invalid image source provided or missing file.Constructor and Description |
---|
BBXImage(BBjImage p_image!)
BBXImage Constructor specifying a BBjImage for the source image
|
BBXImage(BBjString p_imageFile!)
BBXImage Constructor specifying a string for the source image's file path
|
BBXImage(BBjString p_text$,
BBjString p_foreColor$,
BBjNumber p_foreOpacity,
BBjString p_backColor$,
BBjNumber p_backOpacity,
Font p_font!,
BBjNumber p_width,
BBjNumber p_height,
BBjNumber p_hAlign,
BBjNumber p_vAlign,
BBjNumber p_hPadding,
BBjNumber p_vPadding)
BBXImage Constructor that creates a BBXImage object by drawing text on a graphics context.
|
BBXImage(BBXImage p_bbximage!)
BBXImage Constructor specifying another BBXImage for the source image
|
BBXImage(File p_imageFile!)
BBXImage Constructor specifying a Java File object for the source image's file path
|
BBXImage(Image p_image!)
BBXImage Constructor specifying a Java Image object for the source image
|
BBXImage(ImageIcon p_imageIcon!)
BBXImage Constructor specifying an ImageIcon for the source image
|
BBXImage(URL p_imageURL!)
BBXImage Constructor specifying a Java URL object for the source image
|
Modifier and Type | Method and Description |
---|---|
void |
addColorOverlay(BBjColor p_color!)
Method to overlay the BBXImage with a BBjColor (which usually has an alpha component)
|
void |
addColorOverlay(BBjNumber red,
BBjNumber green,
BBjNumber blue,
BBjNumber opacity)
Method to overlay the BBXImage with a color (which usually has an alpha component)
|
BBXImage |
clone()
Method to get a copy of the BBXImage
|
void |
crop(BBjNumber p_x,
BBjNumber p_y,
BBjNumber p_w,
BBjNumber p_h)
Method to crop the BBXImage to a specified rectangular region
|
void |
cropBackground()
Method to return the smallest image possible by cropping out the background of the original image using the top left pixel's color as the base background color to crop out.
|
void |
cropTransparent()
Method to return the smallest image possible by cropping out the transparent edges of the original image
|
void |
drawFilledOval(BBjNumber p_x,
BBjNumber p_y,
BBjNumber p_width,
BBjNumber p_height,
BBjNumber p_thickness,
BBjColor p_outlineColor!,
BBjColor p_fillColor!,
BBjNumber p_rotation)
Method to draw an oval on the BBXImage's canvas, specifying the thickness of the line and the color/opacity of the line.
|
void |
drawFilledOval(BBjNumber p_x,
BBjNumber p_y,
BBjNumber p_width,
BBjNumber p_height,
BBjNumber p_thickness,
Color p_outlineColor!,
Color p_fillColor!)
Method to draw an oval on the BBXImage's canvas, specifying the thickness of the line and the color/opacity of the line.
|
void |
drawFilledOval(BBjNumber p_x,
BBjNumber p_y,
BBjNumber p_width,
BBjNumber p_height,
BBjNumber p_thickness,
Color p_outlineColor!,
Color p_fillColor!,
BBjNumber p_rotation)
Method to draw an oval on the BBXImage's canvas, specifying the thickness of the line and the color/opacity of the line.
|
void |
drawFilledRect(BBjNumber p_x,
BBjNumber p_y,
BBjNumber p_width,
BBjNumber p_height,
BBjNumber p_thickness,
BBjColor p_outlineColor!,
BBjColor p_fillColor!,
BBjNumber p_rotation)
Method to draw a rectangle on the BBXImage's canvas, specifying the thickness of the line and the color/opacity of the line.
|
void |
drawFilledRect(BBjNumber p_x,
BBjNumber p_y,
BBjNumber p_width,
BBjNumber p_height,
BBjNumber p_thickness,
Color p_outlineColor!,
Color p_fillColor!)
Method to draw a rectangle on the BBXImage's canvas, specifying the thickness of the line and the color/opacity of the line.
|
void |
drawFilledRect(BBjNumber p_x,
BBjNumber p_y,
BBjNumber p_width,
BBjNumber p_height,
BBjNumber p_thickness,
Color p_outlineColor!,
Color p_fillColor!,
BBjNumber p_rotation)
Method to draw a rectangle on the BBXImage's canvas, specifying the thickness of the line and the color/opacity of the line.
|
void |
drawOval(BBjNumber p_x,
BBjNumber p_y,
BBjNumber p_width,
BBjNumber p_height,
BBjNumber p_thickness,
BBjColor p_color!)
Method to draw an oval on the BBXImage's canvas, specifying the thickness of the line and the color/opacity of the line.
|
void |
drawOval(BBjNumber p_x,
BBjNumber p_y,
BBjNumber p_width,
BBjNumber p_height,
BBjNumber p_thickness,
BBjNumber red,
BBjNumber green,
BBjNumber blue,
BBjNumber opacity)
Method to draw an oval on the BBXImage's canvas, specifying the thickness of the line and the color/opacity of the line.
|
void |
drawOval(BBjNumber p_x,
BBjNumber p_y,
BBjNumber p_width,
BBjNumber p_height,
BBjNumber p_thickness,
BBjNumber red,
BBjNumber green,
BBjNumber blue,
BBjNumber opacity,
BBjNumber p_rotation)
Method to draw an oval on the BBXImage's canvas, specifying the thickness of the line and the color/opacity of the line.
|
void |
drawOval(BBjNumber p_x,
BBjNumber p_y,
BBjNumber p_width,
BBjNumber p_height,
BBjNumber p_thickness,
Color p_color!)
Method to draw an oval on the BBXImage's canvas, specifying the thickness of the line and the color/opacity of the line.
|
void |
drawRect(BBjNumber p_x,
BBjNumber p_y,
BBjNumber p_width,
BBjNumber p_height,
BBjNumber p_thickness,
BBjColor p_color!)
Method to draw a rectangle on the BBXImage's canvas, specifying the thickness of the line and the color/opacity of the line.
|
void |
drawRect(BBjNumber p_x,
BBjNumber p_y,
BBjNumber p_width,
BBjNumber p_height,
BBjNumber p_thickness,
BBjNumber red,
BBjNumber green,
BBjNumber blue,
BBjNumber opacity)
Method to draw a rectangle on the BBXImage's canvas, specifying the thickness of the line and the color/opacity of the line.
|
void |
drawRect(BBjNumber p_x,
BBjNumber p_y,
BBjNumber p_width,
BBjNumber p_height,
BBjNumber p_thickness,
BBjNumber red,
BBjNumber green,
BBjNumber blue,
BBjNumber opacity,
BBjNumber p_rotation)
Method to draw a rectangle on the BBXImage's canvas, specifying the thickness of the line and the color/opacity of the line.
|
void |
drawRect(BBjNumber p_x,
BBjNumber p_y,
BBjNumber p_width,
BBjNumber p_height,
BBjNumber p_thickness,
Color p_color!)
Method to draw a rectangle on the BBXImage's canvas, specifying the thickness of the line and the color/opacity of the line.
|
BBjNumber |
exists()
Method to determine whether the BBXImage exists or not
|
void |
flipHorizontally()
Method to flip the BBXImage horizontally
|
void |
flipVertically()
Method to flip the BBXImage vertically
|
BBjString |
getBase64()
Method to return the BBXImage out to an Image Output Stream 32-bit converted to a Base64 ASCII Stream
|
BBjImage |
getBBjImage()
Method to get a BBjImage for the BBXImage
|
BufferedImage |
getBufferedImage()
Method to get a BufferedImage of type BufferedImage.TYPE_INT_ARGB from the BBXImage
|
BufferedImage |
getBufferedImage(BBjNumber p_bufferedImageType!)
Method to get a BufferedImage from the BBXImage
|
static Color |
getColorWithAlphaFromHexString(BBjString p_colorHexString$,
BBjNumber p_opacity)
Method to create a Java Color with an alpha channel from a hex string
|
BBjString |
getDescription()
Method to get the description of the BBXImage
|
BBjNumber |
getHeight()
Method to get the height of the BBXImage
|
static BBjString |
getHexStringFromColor(Color p_color!)
Method to get a hex representation of a Java Color with an alpha channel
|
Image |
getImage()
Method to get an ImageIcon from the BBXImage
|
ImageIcon |
getImageIcon()
Method to get an ImageIcon from the BBXImage
|
BBXImage |
getSubimage(BBjNumber p_x,
BBjNumber p_y,
BBjNumber p_w,
BBjNumber p_h)
Method to return a BBXImage that is a subimage defined by a specified rectangular region
|
BBjNumber |
getWidth()
Method to get the width of the BBXImage
|
void |
rotate(BBjNumber p_degrees)
Method to rotate the BBXImage
|
void |
roundBottomCorners(BBjNumber arcWidth,
BBjNumber arcHeight)
Method to round the bottom corners (knockout) of the BBXImage given a cornerRadius
|
void |
roundCorners(BBjNumber arcWidth,
BBjNumber arcHeight)
Method to round the corners (knockout) of the BBXImage given a cornerRadius
|
void |
roundTopCorners(BBjNumber arcWidth,
BBjNumber arcHeight)
Method to round the top corners (knockout) of the BBXImage given a cornerRadius
|
void |
saveAsBMP(BBjString p_imageFile$)
Method to save the BBXImage out to a .bmp file
|
void |
saveAsGIF(BBjString p_imageFile$)
Method to save the BBXImage out to a .gif file
|
void |
saveAsJPG(BBjString p_imageFile$,
BBjNumber p_compressionLevelPercentage)
Method to save the BBXImage out to a .jpg file
|
void |
saveAsPNG(BBjString p_imageFile$)
Method to save the BBXImage out to a 32-bit .png file with transparency
|
void |
saveAsTIFF(BBjString p_imageFile$)
Method to save the BBXImage out to a .tiff file
|
void |
scale(BBjNumber p_percentage)
Method to scale the BBXImage given a percentage
|
void |
scale(BBjNumber p_width,
BBjNumber p_height)
Method to scale the BBXImage given a width and height
|
void |
scaleHeight(BBjNumber p_width)
Method to scale the BBXImage preserving the aspect ratio given the width
|
void |
scaleProportionally(BBjNumber p_maxDimension)
Method to scale the BBXImage preserving the aspect ratio given the maximum width or height dimension.
|
void |
scaleProportionally(BBjNumber p_maxWidth,
BBjNumber p_maxHeight)
Method to scale the BBXImage preserving the aspect ratio given the maximum width and height dimensions.
|
void |
scaleProportionallyAndResizeCanvas(BBjNumber p_maxWidth,
BBjNumber p_maxHeight)
Method to scale the BBXImage preserving the aspect ratio given the maximum width and height dimensions, and then
resize the canvas so that the image will be resized to the specified width and height.
|
void |
scaleProportionallyResizeCanvasAndSetImage(BBjNumber p_maxWidth,
BBjNumber p_maxHeight,
BBjImageCtrl p_imgCtrl!)
Method to scale the BBXImage preserving the aspect ratio given the maximum width and height dimensions, then
resize the canvas so that the image will be resized to the specified width and height.
|
void |
scaleWidth(BBjNumber p_height)
Method to scale the BBXImage preserving the aspect ratio given the height
|
void |
scaleWithHints(BBjNumber p_width,
BBjNumber p_height,
HashMap p_renderingHintsMap!)
Method to scale the BBXImage given a width and height and HashMap of Graphics2D rendering hints
|
void |
setBorder(BBjNumber borderSize,
BBjColor color!)
Method to add a border to the BBXImage
|
void |
setBorder(BBjNumber borderSize,
BBjNumber red,
BBjNumber green,
BBjNumber blue,
BBjNumber opacity)
Method to add a border to the BBXImage
|
void |
setCanvasSize(BBjNumber p_width,
BBjNumber p_height)
Method to resize the BBXImage's canvas, specifying transparent for the fill color.
|
void |
setCanvasSize(BBjNumber p_width,
BBjNumber p_height,
BBjColor p_color!)
Method to resize the BBXImage's canvas.
|
void |
setCanvasSize(BBjNumber p_width,
BBjNumber p_height,
BBjNumber red,
BBjNumber green,
BBjNumber blue,
BBjNumber opacity)
Method to resize the BBXImage's canvas.
|
void |
setCornerWaterMark(BBXImage watermarkImage!,
BBjNumber opacity,
BBjNumber width,
BBjNumber height,
BBjNumber anchorPoint)
Method to add a watermark logo to the BBXImage
|
BBjString |
setDescription(BBjString p_description$)
Method to set the description of the BBXImage
|
void |
setDropShadow(BBjNumber shadowSize,
BBjNumber shadowOpacity,
BBjNumber xOffset,
BBjNumber yOffset)
Method to add a drop shadow to the BBXImage
|
void |
setFilterBlur(BBjNumber p_blurAmount)
Method to filter the BBXImage and increase the blurriness
|
void |
setFilterBrightness(BBjNumber p_fraction)
Method to adjust the brightness of the BBXImage
|
void |
setFilterContrast(BBjNumber p_fraction)
Method to adjust the contrast of the BBXImage
|
void |
setFilterGrayscale()
Method to filter the BBXImage and convert it to grayscale (completely desaturated)
|
void |
setFilterSharpen(BBjNumber p_sharpenAmount)
Method to filter the BBXImage and increase the sharpness
|
void |
setImageIcon(ImageIcon p_imageIcon!)
Method to set the ImageIcon for the BBXImage
|
void |
setOpacity(BBjNumber p_percentTransparent)
Method to set the transparency of the BBXImage
|
void |
setReflection(BBjNumber reflectionLength,
BBjNumber reflectionOpacity,
BBjNumber blurred,
BBjNumber verticalSpace)
Method to add a reflection to the BBXImage
|
public BBXImage(BBXImage p_bbximage!)
public BBXImage(ImageIcon p_imageIcon!)
public BBXImage(Image p_image!)
http://docs.oracle.com/javase/8/docs/api/java/awt/Image.html
public BBXImage(URL p_imageURL!)
http://docs.oracle.com/javase/8/docs/api/java/net/URL.html
public BBXImage(File p_imageFile!)
http://docs.oracle.com/javase/8/docs/api/java/io/File.html
public BBXImage(BBjString p_imageFile!)
public BBXImage(BBjImage p_image!)
public BBXImage(BBjString p_text$, BBjString p_foreColor$, BBjNumber p_foreOpacity, BBjString p_backColor$, BBjNumber p_backOpacity, Font p_font!, BBjNumber p_width, BBjNumber p_height, BBjNumber p_hAlign, BBjNumber p_vAlign, BBjNumber p_hPadding, BBjNumber p_vPadding)
p_text$
- The text string to drawp_foreColor$
- The foreground color of the resultant text specified as a hex color string. An example would be "#ff00cc"p_foreOpacity
- The desired opacity value (0-1) of the foreground color. 0 = Fully Transparent, 1 = Fully Opaque.p_backColor$
- The background color of the resultant text specified as a hex color string. An example would be "#ff00cc"p_backOpacity
- The desired opacity value (0-1) of the background color. 0 = Fully Transparent, 1 = Fully Opaque.p_font!
- The Java Font used to draw the textp_width
- The width of the resultant Image (0 to automatically determine the width)p_height
- The height of the resultant Image (0 to automatically determine the height)p_hAlign
- The horizontal text alignment: 0 = Left, 1 = Center, 2 = Rightp_vAlign
- The vertical text alignment: 0 = Top, 1 = Middle, 2 = Bottomp_hPadding
- The number of pixels of padding to be added horizontally (added to the left and right sides)p_vPadding
- The number of pixels of padding to be added vertically (added to the top and bottom sides)public BBXImage clone()
public BufferedImage getBufferedImage()
http://docs.oracle.com/javase/8/docs/api/java/awt/image/BufferedImage.html
public BufferedImage getBufferedImage(BBjNumber p_bufferedImageType!)
p_bufferedImageType!
- The type of BufferedImage to return, such as BufferedImage.TYPE_INT_ARGBhttp://docs.oracle.com/javase/8/docs/api/java/awt/image/BufferedImage.html
public Image getImage()
http://docs.oracle.com/javase/8/docs/api/java/awt/image/package-summary.html
public ImageIcon getImageIcon()
http://docs.oracle.com/javase/8/docs/api/javax/swing/ImageIcon.html
public void setImageIcon(ImageIcon p_imageIcon!)
An
- ImageIcon containing the desired contents of the BBXImagehttp://docs.oracle.com/javase/8/docs/api/javax/swing/ImageIcon.html
public BBjImage getBBjImage()
http://documentation.basis.com/BASISHelp/WebHelp/gridctrl/bbjimage.htm
public BBjString getBase64()
public BBjNumber getWidth()
public BBjNumber getHeight()
public BBjString getDescription()
public BBXImage getSubimage(BBjNumber p_x, BBjNumber p_y, BBjNumber p_w, BBjNumber p_h)
p_x
- The X coordinate of the upper-left corner of the specified rectangular regionp_y
- The Y coordinate of the upper-left corner of the specified rectangular regionp_w
- The width of the specified rectangular regionp_h
- height of the specified rectangular regionpublic void crop(BBjNumber p_x, BBjNumber p_y, BBjNumber p_w, BBjNumber p_h)
p_x
- The X coordinate of the upper-left corner of the specified rectangular regionp_y
- The Y coordinate of the upper-left corner of the specified rectangular regionp_w
- The width of the specified rectangular regionp_h
- height of the specified rectangular regionpublic BBjString setDescription(BBjString p_description$)
The
- description of the BBXImage. This is meant to be a brief textual description of the object. For example, it might be presented to a blind user to give an indication of the purpose of the image.public void setFilterBrightness(BBjNumber p_fraction)
p_fraction
- The amount to lighten or darken the image. A positive number will lighten the image, a negative number will darken the image. For example, providing a value of 0.5 will make the image 50% brighter. Values range from -1.0 to 1.0.public void setFilterContrast(BBjNumber p_fraction)
p_fraction
- The amount of contrast to add or subtract from the image. A positive number will lighten the image, a negative number will darken the image. For example, providing a value of 0.5 will make the image have 50% more contrast. Values range from -1.0 to 1.0.public void setFilterGrayscale()
public void setFilterBlur(BBjNumber p_blurAmount)
p_blurAmount
- The amount to increase the blurriness. The amount generally ranges from 1 to about 10 for best results.public void setFilterSharpen(BBjNumber p_sharpenAmount)
p_sharpenAmount
- The amount to increase the sharpness. The amount generally ranges from 1 to about 10 for best results.public BBjNumber exists()
public void cropTransparent()
cropBackground()
public void cropBackground()
cropTransparent()
public void scale(BBjNumber p_width, BBjNumber p_height)
p_width
- The desired width of the BBXImagep_height
- The desired height of the BBXImagepublic void scaleWithHints(BBjNumber p_width, BBjNumber p_height, HashMap p_renderingHintsMap!)
Java's RenderingHints allow you to specify the interpolation method used when scaling the image. The possible values are:
Generally speaking, the interpolations values shown above range from quickest with poorest quality (VALUE_INTERPOLATION_NEAREST_NEIGHBOR) to slowest with best quality (VALUE_INTERPOLATION_BICUBIC). In practice, bilinear and bicubic interpolation produce results that are very similar. Bicubic will be slightly sharper than bilinear, with a bit more emphasis on edges. That translates to bicubic often being a better choice for image reduction, whereas blinear is usually better for image enlargement.
Following is a short example showing how to use this method:
use java.util.HashMap use java.awt.RenderingHints hintsMap! = new HashMap() hintsMap!.put(RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_BICUBIC) xImage!.scaleWithHints(width, height, hintsMap!)
p_width
- The desired width of the BBXImagep_height
- The desired height of the BBXImagep_renderingHintsMap!
- A HashMap of Graphics2d rendering hintspublic void scale(BBjNumber p_percentage)
p_percentage
- The percentage amount (0 - 100) to scale the BBXImagepublic void scaleWidth(BBjNumber p_height)
p_height
- The desired height of the BBXImagepublic void scaleHeight(BBjNumber p_width)
p_width
- The desired width of the BBXImagepublic void scaleProportionally(BBjNumber p_maxDimension)
This method is useful in the case where you'd like to resize the source image ensuring that it will maintain its original proportions and will fit within a square of a particular size.
p_maxDimension
- The desired maximum width and height of the resultant imagepublic void scaleProportionally(BBjNumber p_maxWidth, BBjNumber p_maxHeight)
This method is useful in the case where you'd like to resize the source image ensuring that it will maintain its original proportions and will fit within a rectangle of a particular size.
p_maxWidth
- The desired maximum width of the resultant imagep_maxHeight
- The desired maximum height of the resultant imagepublic void scaleProportionallyAndResizeCanvas(BBjNumber p_maxWidth, BBjNumber p_maxHeight)
This method is useful in the case where you'd like to resize the source image ensuring that it will maintain its original proportions and will fit within a rectangle of a particular size.
p_maxWidth
- The desired maximum width of the resultant imagep_maxHeight
- The desired maximum height of the resultant imagepublic void scaleProportionallyResizeCanvasAndSetImage(BBjNumber p_maxWidth, BBjNumber p_maxHeight, BBjImageCtrl p_imgCtrl!)
This method is useful in the case where you'd like to resize the an image ensuring that it will maintain its original proportions and will fit within a BBjImageCtrl of a particular size.
p_maxWidth
- The desired maximum width of the resultant image, usually the BBjImageCtrl's widthp_maxHeight
- The desired maximum height of the resultant image, usually the BBjImageCtrl's heightp_imgCtrl!
- The BBjImageCtrl that will display the resultant imagepublic void drawFilledRect(BBjNumber p_x, BBjNumber p_y, BBjNumber p_width, BBjNumber p_height, BBjNumber p_thickness, Color p_outlineColor!, Color p_fillColor!)
p_x
- The desired x coordinate of the rectanglep_y
- The desired y coordinate of the rectanglep_width
- The desired width of the rectanglep_height
- The desired height of the rectanglep_thickness
- The desired thickness of the rectanglep_outlineColor!
- The Java Color that will be used to draw the shapep_fillColor!
- The Java Color that will be used to fill the shapepublic void drawFilledRect(BBjNumber p_x, BBjNumber p_y, BBjNumber p_width, BBjNumber p_height, BBjNumber p_thickness, BBjColor p_outlineColor!, BBjColor p_fillColor!, BBjNumber p_rotation)
p_x
- The desired x coordinate of the rectanglep_y
- The desired y coordinate of the rectanglep_width
- The desired width of the rectanglep_height
- The desired height of the rectanglep_thickness
- The desired thickness of the rectanglep_outlineColor!
- The BBjColor that will be used to draw the shapep_fillColor!
- The BBjColor that will be used to fill the shapep_rotation
- The angle in degrees to rotate the shape around its centerpublic void drawFilledRect(BBjNumber p_x, BBjNumber p_y, BBjNumber p_width, BBjNumber p_height, BBjNumber p_thickness, Color p_outlineColor!, Color p_fillColor!, BBjNumber p_rotation)
p_x
- The desired x coordinate of the rectanglep_y
- The desired y coordinate of the rectanglep_width
- The desired width of the rectanglep_height
- The desired height of the rectanglep_thickness
- The desired thickness of the rectanglep_outlineColor!
- The Java Color that will be used to draw the shapep_fillColor!
- The Java Color that will be used to fill the shapep_rotation
- The angle in degrees to rotate the shape around its centerpublic void drawFilledOval(BBjNumber p_x, BBjNumber p_y, BBjNumber p_width, BBjNumber p_height, BBjNumber p_thickness, Color p_outlineColor!, Color p_fillColor!)
Note that specifying the same value for the width and height results in a circle.
p_x
- The desired x coordinate of the rectanglep_y
- The desired y coordinate of the rectanglep_width
- The desired width of the rectanglep_height
- The desired height of the rectanglep_thickness
- The desired thickness of the rectanglep_outlineColor!
- The Java Color that will be used to draw the shapep_fillColor!
- The Java Color that will be used to fill the shapepublic void drawFilledOval(BBjNumber p_x, BBjNumber p_y, BBjNumber p_width, BBjNumber p_height, BBjNumber p_thickness, BBjColor p_outlineColor!, BBjColor p_fillColor!, BBjNumber p_rotation)
Note that specifying the same value for the width and height results in a circle.
p_x
- The desired x coordinate of the rectanglep_y
- The desired y coordinate of the rectanglep_width
- The desired width of the rectanglep_height
- The desired height of the rectanglep_thickness
- The desired thickness of the rectanglep_outlineColor!
- The BBjColor that will be used to draw the shapep_fillColor!
- The BBjColor that will be used to fill the shapep_rotation
- The angle in degrees to rotate the shape around its centerpublic void drawFilledOval(BBjNumber p_x, BBjNumber p_y, BBjNumber p_width, BBjNumber p_height, BBjNumber p_thickness, Color p_outlineColor!, Color p_fillColor!, BBjNumber p_rotation)
Note that specifying the same value for the width and height results in a circle.
p_x
- The desired x coordinate of the rectanglep_y
- The desired y coordinate of the rectanglep_width
- The desired width of the rectanglep_height
- The desired height of the rectanglep_thickness
- The desired thickness of the rectanglep_outlineColor!
- The Java Color that will be used to draw the shapep_fillColor!
- The Java Color that will be used to fill the shapep_rotation
- The angle in degrees to rotate the shape around its centerpublic void drawRect(BBjNumber p_x, BBjNumber p_y, BBjNumber p_width, BBjNumber p_height, BBjNumber p_thickness, BBjColor p_color!)
p_x
- The desired x coordinate of the rectanglep_y
- The desired y coordinate of the rectanglep_width
- The desired width of the rectanglep_height
- The desired height of the rectanglep_thickness
- The desired thickness of the rectanglep_color!
- The BBjColor that will be used to draw the shapepublic void drawRect(BBjNumber p_x, BBjNumber p_y, BBjNumber p_width, BBjNumber p_height, BBjNumber p_thickness, Color p_color!)
p_x
- The desired x coordinate of the rectanglep_y
- The desired y coordinate of the rectanglep_width
- The desired width of the rectanglep_height
- The desired height of the rectanglep_thickness
- The desired thickness of the rectanglep_color!
- The Java Color that will be used to draw the shapepublic void drawRect(BBjNumber p_x, BBjNumber p_y, BBjNumber p_width, BBjNumber p_height, BBjNumber p_thickness, BBjNumber red, BBjNumber green, BBjNumber blue, BBjNumber opacity)
p_x
- The desired x coordinate of the rectanglep_y
- The desired y coordinate of the rectanglep_width
- The desired width of the rectanglep_height
- The desired height of the rectanglep_thickness
- The desired thickness of the rectanglered
- The red component of the rectangle's color (0 - 1)green
- The green component of the rectangle's color (0 - 1)blue
- The blue component of the rectangle's color (0 - 1)opacity
- The opacity component of the rectangle's color (0 - 1)public void drawRect(BBjNumber p_x, BBjNumber p_y, BBjNumber p_width, BBjNumber p_height, BBjNumber p_thickness, BBjNumber red, BBjNumber green, BBjNumber blue, BBjNumber opacity, BBjNumber p_rotation)
p_x
- The desired x coordinate of the rectanglep_y
- The desired y coordinate of the rectanglep_width
- The desired width of the rectanglep_height
- The desired height of the rectanglep_thickness
- The desired thickness of the rectanglered
- The red component of the rectangle's color (0 - 1)green
- The green component of the rectangle's color (0 - 1)blue
- The blue component of the rectangle's color (0 - 1)opacity
- The opacity component of the rectangle's color (0 - 1)p_rotation
- The angle in degrees to rotate the shape around its centerpublic void drawOval(BBjNumber p_x, BBjNumber p_y, BBjNumber p_width, BBjNumber p_height, BBjNumber p_thickness, Color p_color!)
Note that specifying the same value for the width and height results in a circle.
p_x
- The desired x coordinate of the ovalp_y
- The desired y coordinate of the ovalp_width
- The desired width of the ovalp_height
- The desired height of the ovalp_thickness
- The desired thickness of the ovalp_color
- The Java Color that will be used to draw the shapepublic void drawOval(BBjNumber p_x, BBjNumber p_y, BBjNumber p_width, BBjNumber p_height, BBjNumber p_thickness, BBjColor p_color!)
Note that specifying the same value for the width and height results in a circle.
p_x
- The desired x coordinate of the ovalp_y
- The desired y coordinate of the ovalp_width
- The desired width of the ovalp_height
- The desired height of the ovalp_thickness
- The desired thickness of the ovalp_color!
- The oval's color expressed as a BBjColorpublic void drawOval(BBjNumber p_x, BBjNumber p_y, BBjNumber p_width, BBjNumber p_height, BBjNumber p_thickness, BBjNumber red, BBjNumber green, BBjNumber blue, BBjNumber opacity)
Note that specifying the same value for the width and height results in a circle.
p_x
- The desired x coordinate of the ovalp_y
- The desired y coordinate of the ovalp_width
- The desired width of the ovalp_height
- The desired height of the ovalp_thickness
- The desired thickness of the ovalred
- The red component of the oval's color (0 - 1)green
- The green component of the oval's color (0 - 1)blue
- The blue component of the oval's color (0 - 1)opacity
- The opacity component of the oval's color (0 - 1)public void drawOval(BBjNumber p_x, BBjNumber p_y, BBjNumber p_width, BBjNumber p_height, BBjNumber p_thickness, BBjNumber red, BBjNumber green, BBjNumber blue, BBjNumber opacity, BBjNumber p_rotation)
Note that specifying the same value for the width and height results in a circle.
p_x
- The desired x coordinate of the ovalp_y
- The desired y coordinate of the ovalp_width
- The desired width of the ovalp_height
- The desired height of the ovalp_thickness
- The desired thickness of the ovalred
- The red component of the oval's color (0 - 1)green
- The green component of the oval's color (0 - 1)blue
- The blue component of the oval's color (0 - 1)opacity
- The opacity component of the oval's color (0 - 1)p_rotation
- The angle in degrees to rotate the shape around its centerpublic void setCanvasSize(BBjNumber p_width, BBjNumber p_height)
p_width
- The desired width of the BBXImage's canvasp_height
- The desired height of the BBXImage's canvaspublic void setCanvasSize(BBjNumber p_width, BBjNumber p_height, BBjColor p_color!)
p_width
- The desired width of the BBXImage's canvasp_height
- The desired height of the BBXImage's canvasp_color!
- The background color expressed as a BBjColorpublic void setCanvasSize(BBjNumber p_width, BBjNumber p_height, BBjNumber red, BBjNumber green, BBjNumber blue, BBjNumber opacity)
p_width
- The desired width of the BBXImage's canvasp_height
- The desired height of the BBXImage's canvasred
- The red component of the added color (0 - 1)green
- The green component of the added color (0 - 1)blue
- The blue component of the added color (0 - 1)opacity
- The opacity component of the added color (0 - 1)public void flipVertically()
public void flipHorizontally()
public void rotate(BBjNumber p_degrees)
The image will be rotated around the center point, and a positive rotation angle corresponds to rotating the image in a clockwise fashion. Note that the new image will be larger than the original image to avoid truncating rotated edges.
p_degrees
- The number of degrees (-360 to +360) to rotate the BBXImagepublic void addColorOverlay(BBjColor p_color!)
BBjColor
- The BBjColor to place over the BBXImagepublic void addColorOverlay(BBjNumber red, BBjNumber green, BBjNumber blue, BBjNumber opacity)
red
- The red component of the color (0 - 1) to place over the BBXImagegreen
- The green component of the color (0 - 1) to place over the BBXImageblue
- The blue component of the color (0 - 1) to place over the BBXImageopacity
- The opacity component of the color (0 - 1) to place over the BBXImagepublic void setOpacity(BBjNumber p_percentTransparent)
p_percentTransparent
- The percentage (0 - 100) to set the amount of transparency of the BBXImagepublic void roundCorners(BBjNumber arcWidth, BBjNumber arcHeight)
arcWidth
- The corner radius in the X directionarcHeight
- The corner radius in the Y directionpublic void roundTopCorners(BBjNumber arcWidth, BBjNumber arcHeight)
arcWidth
- The corner radius in the X directionarcHeight
- The corner radius in the Y directionpublic void roundBottomCorners(BBjNumber arcWidth, BBjNumber arcHeight)
arcWidth
- The corner radius in the X directionarcHeight
- The corner radius in the Y directionpublic void setBorder(BBjNumber borderSize, BBjColor color!)
borderSize
- The width of the bordercolor
- The color of the border expressed as a BBjColorpublic void setBorder(BBjNumber borderSize, BBjNumber red, BBjNumber green, BBjNumber blue, BBjNumber opacity)
borderSize
- The width of the borderred
- The red component of the border color (0 - 1)green
- The green component of the border color (0 - 1)blue
- The blue component of the border color (0 - 1)opacity
- The opacity component of the border color (0 - 1)public void setDropShadow(BBjNumber shadowSize, BBjNumber shadowOpacity, BBjNumber xOffset, BBjNumber yOffset)
shadowSize
- The size in pixels of the shadowshadowOpacity
- The opacity of the shadow (0 - 1)xOffset
- The shadow's offset in the X directionyOffset
- The shadow's offset in the Y directionpublic void setReflection(BBjNumber reflectionLength, BBjNumber reflectionOpacity, BBjNumber blurred, BBjNumber verticalSpace)
reflectionLength
- The height in pixels of the reflectionreflectionOpacity
- The opacity of the reflection (0 - 1)blurred
- 1 = blur the reflection, 0 = do not blur the reflectionverticalSpace
- Spacing in pixels between the original image and the reflectionpublic void setCornerWaterMark(BBXImage watermarkImage!, BBjNumber opacity, BBjNumber width, BBjNumber height, BBjNumber anchorPoint)
watermarkImage!
- A BBXImage that contains the watermark imageopacity
- The desired opacity of the watermark (0 - 1)width
- The width of the watermark when placed on the targetheight
- The height of the watermark when placed on the targetanchorPoint
- The corner of the target image on which to place the watermark. 0 = TopLeft, 1 = TopRight, 2 = BottomRight, 3 = BottomLeftpublic void saveAsGIF(BBjString p_imageFile$)
p_imageFile$
- The path and filename for the resultant .gif imagepublic void saveAsBMP(BBjString p_imageFile$)
p_imageFile$
- The path and filename for the resultant .bmp imagepublic void saveAsTIFF(BBjString p_imageFile$)
p_imageFile$
- The path and filename for the resultant .tiff imagepublic void saveAsPNG(BBjString p_imageFile$)
p_imageFile$
- The path and filename for the resultant .png imagepublic void saveAsJPG(BBjString p_imageFile$, BBjNumber p_compressionLevelPercentage)
p_imageFile$
- The path and filename for the resultant .jpg imagep_compressionLevelPercentage
- The amount (0 - 100) to compress the resultant .jpg imagepublic static Color getColorWithAlphaFromHexString(BBjString p_colorHexString$, BBjNumber p_opacity)
p_colorHexString$
- A hex color string. An example would be "#ff00cc"p_opacity
- The desired opacity value (0-1). 0 = Fully Transparent, 1 = Fully Opaque.http://docs.oracle.com/javase/8/docs/api/java/awt/Color.html
public static BBjString getHexStringFromColor(Color p_color!)
p_color!
- A Java Color