Win a copy of Testing JavaScript Applications this week in the HTML Pages with CSS and JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

whats wrong with Jimi

 
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hallo,
this code opens a image, writes text on it and saves it to a file. But somethin is wrong, i can't see the text on the saved image (
Ben

[ September 12, 2002: Message edited by: Ben Klug ]
 
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Need more input.
Whats a 'Jimi'?
 
Ranch Hand
Posts: 401
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't know anything about Jimi, but I look at your code and you are doing this:
  • Have "Jimi" read an image
  • Create a Graphics object
  • Write the image to that graphics
  • Write some text to that graphics
  • Dispose of the graphics (bye-bye)
  • Have "Jimi" write the original image back to a file


  • Maybe you want to extract the image+text from the graphics and write that out to a file or something.
     
    Ben Klug
    Ranch Hand
    Posts: 45
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Hi,
    sorry, Jimi is a class library for managing images from sun.
    Dave, I've tried to first save the image and then call dispose(). It didn't work too.
    thanks
    Ben
    [ September 12, 2002: Message edited by: Ben Klug ]
     
    David O'Meara
    Rancher
    Posts: 13459
    Android Eclipse IDE Ubuntu
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    I've downloaded and had a look at Jimi. Looks nice, I might have to use it myself.
    It does look like your are over complicating things with all of the 'Frame' stuff.
    You probably want to do something more like this:
  • get Jimi to load the image
  • get a Graphics context for the image
  • write the text to the graphics context
  • use Jimi to save the modified Image as the required type
  • (close the Graphics context and any other resources)


  • Without playing I can't help more, but I hope this helps.
    Dave.
     
    Ben Klug
    Ranch Hand
    Posts: 45
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Thanks David,
    I've tried to handle th Image like this:

    but I get the following error:

    I think the problem is not Jimi, the Problem is getting the Graphics-Object from the image.

    Ben
    [ September 13, 2002: Message edited by: Ben Klug ]
    [ September 13, 2002: Message edited by: Ben Klug ]
     
    Every snowflake is perfect and unique. And every snowflake contains a very tiny ad.
    Thread Boost feature
    https://coderanch.com/t/674455/Thread-Boost-feature
      Bookmark Topic Watch Topic
    • New Topic