did you ever needed to create dynamic images on fly. Yeah i happened to do this for custom registration form where you create dynamic images on fly and ask the user to entered the characters inside the image and then validate the data at the server side.
It is very simple Java code, take a look at it.
BufferedImage image = new BufferedImage(150, 50, BufferedImage.SCALE_SMOOTH);
Graphics g = image.getGraphics();
AffineTransform fontAT = new AffineTransform();
fontAT.setToShear(-1.22, 0.2);
Font theFont = new Font("Arial" , Font.TRUETYPE_FONT , 22);
Font theDerivedFont = theFont.deriveFont(fontAT);
g.setFont(theDerivedFont);
g.drawString( ImageString , 10, 25);
g.drawLine(0, 10, 150, 50) ;
ImageIO.write(image, "jpg", new File("C:\\Image.jpg"));
Note:- This Java code needs to run at the server side and it would create an image in the location which you provide
Image String is the string which will be written on the image.
It is very simple Java code, take a look at it.
BufferedImage image = new BufferedImage(150, 50, BufferedImage.SCALE_SMOOTH);
Graphics g = image.getGraphics();
AffineTransform fontAT = new AffineTransform();
fontAT.setToShear(-1.22, 0.2);
Font theFont = new Font("Arial" , Font.TRUETYPE_FONT , 22);
Font theDerivedFont = theFont.deriveFont(fontAT);
g.setFont(theDerivedFont);
g.drawString( ImageString , 10, 25);
g.drawLine(0, 10, 150, 50) ;
ImageIO.write(image, "jpg", new File("C:\\Image.jpg"));
Note:- This Java code needs to run at the server side and it would create an image in the location which you provide
Image String is the string which will be written on the image.