Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.
Converting text to image in java awt
This tip describes how text can be converted to image using Java awt..
Step1: Create a String which we will convert to image
Step2: Create a BufferedImage
Step3: Create get the height and width of the String
Step4: call the createGraphics(), which draws the BufferedImage object to Graphics2D object
Step6: set the font color, backgroung color etc as required
0 · ·