Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

merging images

Posted on 2005-03-27
7
Medium Priority
?
191 Views
Last Modified: 2010-03-31
I have some images 100x100 and I want to replace the area in the top left corner 20x20 with a different image.  I'm using Java 1.1.8 so I can't use buffered images to handle this.  What is another way to accomplish this?

Thanks,
David
0
Comment
Question by:lomidien
  • 4
  • 2
7 Comments
 
LVL 86

Expert Comment

by:CEHJ
ID: 13639127
I think this library supports 1.1. If there is no built-in method to do what you want, simply paint the new image over the old using the same graphics context then save it to file:

http://rsb.info.nih.gov/ij/index.html
0
 

Author Comment

by:lomidien
ID: 13640006
I had already tried using the Graphics context by caling .getGraphics() and issuing paint commands, however I get the following error:

getGraphics() not valid for images created with createImage(producer)

I'm using getImage() to get the image from a file and I don't understand why this error would happen.....I'm doing this in an applet if that makes any difference.

Thanks,
David
0
 
LVL 86

Accepted Solution

by:
CEHJ earned 2000 total points
ID: 13640093
Try calling createImage and then call getGraphics on that. draw both images to *that* graphics context
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 92

Expert Comment

by:objects
ID: 13640522
Create a new blank image, and paint your loaded image to that one. Then paint your 20x20 tile on that image.
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 13640551
>> Create a new blank image ..

Already said that ;-)
0
 
LVL 92

Expert Comment

by:objects
ID: 13640596
Can you also please post how you are loading the image, and from where exactly.
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 13854984
:-)
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This was posted to the Netbeans forum a Feb, 2010 and I also sent it to Verisign. Who didn't help much in my struggles to get my application signed. ------------------------- Start The idea here is to target your cell phones with the correct…
Introduction Java can be integrated with native programs using an interface called JNI(Java Native Interface). Native programs are programs which can directly run on the processor. JNI is simply a naming and calling convention so that the JVM (Java…
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
Suggested Courses
Course of the Month11 days, 4 hours left to enroll

571 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question