Dear Sir/Madam,
I try to make a function for image processing using java, I have add a menu item "Add Icon" under the menu bar. The function should read a file Icon.gif and place the icon at the top left hand corner of the image.
The following code is what I tried to do ...
after checking the user whether to select 'add icon',
if (s == "Add Icon") {
mBufferedImage = processor.AddIcon(mBufferedImage);
}
then it will run the class AddIcon as below...
public BufferedImage AddIcon (BufferedImage inputImage) {
BufferedImage icon = null;
Graphics g = inputImage.getGraphics();
g.drawImage(icon, 0,0, null);
return mBufferedImage;
}
I am just a beginner for the java programming and hope that someone can teach me:
1.how to ask the user to input the second image to place at the corner and
2.how to amend the class AddIcon to make it really work.
Thanks a lot for your kindly help!