bluering.nl contact mail a message

This page describes methods for adding objects to Images.

Methods

void fill(int v)

fill the entire image with the given value.

fill(int x,int y,int w,int h,int v)

fill a rectangle with the given value. x is the horizontal coordinate of upper left corner y is the vertical coordinate of upper left corner w is the width of the rectangle h is the height of the rectangle v is the new pixelvalue

UPRIGHT=1,CENTER=0,DOWNLEFT=-1

alignment constants for use in drawString

void drawString(String s,int x,int y,int halign,int valign)

draw a string in this image. It uses java.awt methods (so it calls getGr()). s is the text to draw. x is the horizontal position. y is the vertical position. halign is the horizontal alignment. If it is UPRIGHT the text appears on the right of the position, if CENTER it appears on both sides of x,y and if DOWNLEFT it appears left of x,y. valign is the vertical alignment. If it is UPRIGHT the text appears above the x,y position, if CENTER it appears on both sides of x,y and if DOWNLEFT it appears below x,y

int stringwidth(String s,Font f)

Return the width of s when drawn in Font f

int stringheight(String s,Font f)

Return the height of s when drawn in Font f

static Image24 shadowtext(Font f,String s,Color tc,int shift)

Draw the text s in font f and color tc, and add a shadow on distance shift.
Image24 text=Image24.shadowtext(
new Font("Courier",Font.PLAIN,40),
"blueRing",
im.color(0,200,0,255),im.color(0,0,0,150),14);
text=text.scale(out.sx,(text.sy*out.sx)/text.sx);
out.pasteover(text,0,0);

[click here if you see no menu]