File tree Expand file tree Collapse file tree 1 file changed +13
-1
lines changed
kotlin/services/bedrock-runtime/src/main/kotlin/com/example/bedrockruntime/libs Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -10,7 +10,19 @@ import javax.swing.ImageIcon
1010import javax.swing.JFrame
1111import javax.swing.JLabel
1212
13+ /* *
14+ * Utility object for handling image-related operations.
15+ */
1316object ImageTools {
17+ /* *
18+ * Displays a byte array as an image in a new window.
19+ *
20+ * Creates a new JFrame window that displays the image represented by the provided byte array.
21+ * The window will close the application when closed (EXIT_ON_CLOSE).
22+ *
23+ * @param imageData The image data as a byte array
24+ * @throws RuntimeException if there is an error reading the image data
25+ */
1426 fun displayImage (imageData : ByteArray ) {
1527 try {
1628 val image = ImageIO .read(ByteArrayInputStream (imageData))
@@ -24,4 +36,4 @@ object ImageTools {
2436 throw RuntimeException (e)
2537 }
2638 }
27- }
39+ }
You can’t perform that action at this time.
0 commit comments