Skip to content

Commit d10d5a0

Browse files
Add files via upload
1 parent ed8de4e commit d10d5a0

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
package simplejavacalculator;
2+
3+
import java.io.*;
4+
import java.awt.image.BufferedImage;
5+
import javax.imageio.ImageIO;
6+
import java.awt.*;
7+
8+
/**
9+
*This class will return an image
10+
*from a binary data.
11+
*/
12+
class BufferedImageCustom {
13+
public Image imageReturn()
14+
throws IOException {
15+
Image image;
16+
17+
//the image here is not even an image file
18+
//but rather a binary data
19+
InputStream bis = getClass().getResourceAsStream("/icon/icon.png");
20+
BufferedImage bImage2 = ImageIO.read(bis);
21+
image = bImage2;
22+
23+
return image;
24+
}
25+
}

0 commit comments

Comments
 (0)