/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package org.geoforge.java.awt.texturepaint;
import java.awt.Color;
import java.awt.Graphics2D;
import java.awt.Image;
import java.awt.Rectangle;
import java.awt.TexturePaint;
import java.awt.image.BufferedImage;
/**
*
* @author bill
*/
public class GfrFactoryTexturePaint extends Object
{
static public TexturePaint s_get(
Image img,
Color colBg,
int intSizeSquareIcon)
{
BufferedImage bie = new BufferedImage(
intSizeSquareIcon,
intSizeSquareIcon,
BufferedImage.TYPE_INT_ARGB // ATTN !TYPE_INT_RGB
);
Graphics2D g2d = bie.createGraphics();
g2d.drawImage(img, 0, 0, colBg, null);
Rectangle rec = new Rectangle(0, 0, intSizeSquareIcon, intSizeSquareIcon);
TexturePaint tpt = new TexturePaint(bie, rec);
g2d.dispose();
return tpt;
}
private GfrFactoryTexturePaint()
{
super();
}
}