We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d1adaa4 commit 5148604Copy full SHA for 5148604
processing_app/library/chooser/resizable.rb
@@ -0,0 +1,33 @@
1
+load_library :chooser
2
+
3
+attr_reader :img
4
5
+def settings
6
+ size(400, 200)
7
+end
8
9
+def setup
10
+ sketch_title 'Chooser'
11
+ resizable
12
+ fill 0, 0, 200
13
+ text('Click Window to Load Image', 10, 100)
14
15
16
+def draw
17
+ image(img, 0, 0) unless img.nil?
18
19
20
+def file_selected(selection)
21
+ if selection.nil?
22
+ puts 'Nothing Chosen'
23
+ else
24
+ @img = load_image(selection.get_absolute_path)
25
+ surface.set_size(img.width, img.height)
26
+ end
27
28
29
+def mouse_clicked
30
+ @img = nil
31
+ # java_signature 'void selectInput(String, String)'
32
+ select_input('select an image', 'file_selected')
33
0 commit comments