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
10
10
import javax.swing.JFrame
11
11
import javax.swing.JLabel
12
12
13
+ /* *
14
+ * Utility object for handling image-related operations.
15
+ */
13
16
object 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
+ */
14
26
fun displayImage (imageData : ByteArray ) {
15
27
try {
16
28
val image = ImageIO .read(ByteArrayInputStream (imageData))
@@ -24,4 +36,4 @@ object ImageTools {
24
36
throw RuntimeException (e)
25
37
}
26
38
}
27
- }
39
+ }
You can’t perform that action at this time.
0 commit comments