Home | History | Annotate | Download | only in view

Lines Matching refs:Image

22 import java.awt.Image;
23 import java.awt.image.BufferedImage;
24 import java.awt.image.DataBufferInt;
33 * Adds a drop shadow to a semi-transparent image (of an arbitrary shape) and returns it as a
34 * new image. This method attempts to mimic the same visual characteristics as the rectangular
35 * shadow painting methods in this class, {@link #createRectangularDropShadow(java.awt.image.BufferedImage)}
36 * and {@link #createSmallRectangularDropShadow(java.awt.image.BufferedImage)}.
38 * If shadowSize is less or equals to 1, no shadow will be painted and the source image will be
41 * @param source the source image
45 * @return an image with the shadow painted in or the source image if shadowSize <= 1
55 * Creates a drop shadow of a given image and returns a new image which shows the input image on
61 * @param source the source image to be shadowed
66 * @return a new image with the source image on top of its shadow when shadowSize > 0 or the
67 * source image otherwise
79 BufferedImage image;
82 image = new BufferedImage(width + SHADOW_SIZE, height + SHADOW_SIZE,
85 Graphics2D g2 = image.createGraphics();
86 g2.drawImage(image, shadowSize, shadowSize, null);
88 int dstWidth = image.getWidth();
89 int dstHeight = image.getHeight();
105 int[] dataBuffer = ((DataBufferInt) image.getRaster().getDataBuffer()).getData();
171 return image;
176 * the given source and returns a new image with both combined
178 * @param source the source image
180 * @return the source image with a drop shadow on the bottom and right
191 BufferedImage image;
192 image = new BufferedImage(width + SHADOW_SIZE, height + SHADOW_SIZE, type);
193 Graphics2D g = image.createGraphics();
195 drawRectangleShadow(image, 0, 0, width, height);
198 return image;
203 * #SMALL_SHADOW_SIZE} around the given source and returns a new image with both combined
205 * @param source the source image
207 * @return the source image with a drop shadow on the bottom and right
219 BufferedImage image;
220 image = new BufferedImage(width + SMALL_SHADOW_SIZE, height + SMALL_SHADOW_SIZE, type);
222 Graphics2D g = image.createGraphics();
224 drawSmallRectangleShadow(image, 0, 0, width, height);
227 return image;
235 * @param image the image to draw the shadow into
241 public static void drawRectangleShadow(BufferedImage image,
243 Graphics2D gc = image.createGraphics();
256 * @param image the image to draw the shadow into
262 public static void drawSmallRectangleShadow(BufferedImage image,
264 Graphics2D gc = image.createGraphics();
367 private static Image loadIcon(String name) {
370 throw new RuntimeException("Unable to load image for shadow: " + name);
375 throw new RuntimeException("Unable to load image for shadow:" + name, e);
406 private static final Image ShadowBottom = loadIcon("/icons/shadow-b.png");
407 private static final Image ShadowBottomLeft = loadIcon("/icons/shadow-bl.png");
408 private static final Image ShadowBottomRight = loadIcon("/icons/shadow-br.png");
409 private static final Image ShadowRight = loadIcon("/icons/shadow-r.png");
410 private static final Image ShadowTopRight = loadIcon("/icons/shadow-tr.png");
411 private static final Image ShadowTopLeft = loadIcon("/icons/shadow-tl.png");
412 private static final Image ShadowLeft = loadIcon("/icons/shadow-l.png");
415 private static final Image Shadow2Bottom = loadIcon("/icons/shadow2-b.png");
416 private static final Image Shadow2BottomLeft = loadIcon("/icons/shadow2-bl.png");
417 private static final Image Shadow2BottomRight = loadIcon("/icons/shadow2-br.png");
418 private static final Image Shadow2Right = loadIcon("/icons/shadow2-r.png");
419 private static final Image Shadow2TopRight = loadIcon("/icons/shadow2-tr.png");
420 private static final Image Shadow2TopLeft = loadIcon("/icons/shadow2-tl.png");
421 private static final Image Shadow2Left = loadIcon("/icons/shadow2-l.png");