This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Swing / AWT / SWT and the fly likes Trying to load an image and modifying it.... Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Trying to load an image and modifying it...." Watch "Trying to load an image and modifying it...." New topic
Author

Trying to load an image and modifying it....

Nick St-Peter
Greenhorn

Joined: Feb 12, 2005
Posts: 26
Hi!

I am trying to load an image (background) which I can later modify using the drawString, drawRect, etc... methods of the Graphics class (the JVM I must use is 1.1.8 and it cannot be changed so I believe forces me to use Graphics instead of Graphics2D)..

I tried to load the image and draw on it and that didn't work (it crashed...) so I tried to create a new image and draw the first one on it and while that didn't crash the image was never actually drawn on the first...

Is there a known good way to do what I want to do (and that works with such an old JDK...)?

Thanks!

Nick
Michael Dunn
Ranch Hand

Joined: Jun 09, 2003
Posts: 4632
don't know how compliant this is with 1.1.8 (can't test it)

Nick St-Peter
Greenhorn

Joined: Feb 12, 2005
Posts: 26
Thanks!!!

I can't test for now as I don't have such an old JVM at home either...

Have a nice day!

Nick
Nick St-Peter
Greenhorn

Joined: Feb 12, 2005
Posts: 26
[browser just crashed so I have to retype everything... ]

O.k.

I got it to work, at least partially, by combining some parts of the code above with some info I found elsewhere on the web...

The problem I have now is that everything is in gray scale... I had read somewhere that this could be an issue with that JDK (1.1) but I thought it was only when drawImage() was used but even if I don't use it everything is still in black & white...

Was JDK 1.1 limited to using only gray scale graphics, I find this hard to believe...

Nick

PS: Thanks Jeff for telling me where I could delete my previous post...
 
jQuery in Action, 2nd edition
 
subject: Trying to load an image and modifying it....
 
Similar Threads
Confused about painting in JPanels
Disappearing Graphics on panel
DISPLAY an IMAGE
Getting pixels from a Graphics instance
How to draw an image in an applet?