• Post Reply Bookmark Topic Watch Topic
  • New Topic

How to put the jpeg's filename at the bottom right of the jpeg file.  RSS feed

 
H Paul
Ranch Hand
Posts: 491
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I have a jpeg file. I used ms Paint to open it and create a text with the jpeg's filename at the bottom right. This is a manual process.
I just wanted to how and what I need to do this using java.

Thanks 1M,

Paul.

 
Darryl Burke
Bartender
Posts: 5167
11
Java Netbeans IDE Opera
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Paul, and welcome to the Ranch!

  • read the file to a BufferedImage using ImageIO#read(...)
  • Obtain the image's Graphics using getGraphics() or createGraphics()
  • drawText(...) the String, at appropriately computed coordinates.
  • write the Image to a new file using ImageIO#write(...)


  • You can find a lot of tips on dealing with images in Java here
     
    • Post Reply Bookmark Topic Watch Topic
    • New Topic
    Boost this thread!