Sha256: 2338fb2fae8a64dfc19993c3f0268c110c381105466933480a845a31bc66dd11

Contents?: true

Size: 410 Bytes

Versions: 4

Compression:

Stored size: 410 Bytes

Contents

#
# Save One Image
# 
# The save function allows you to save an image from the 
# display window. In this example, save is run when a mouse
# button is pressed. The image "line.tif" is saved to the 
# same folder as the sketch's program file.
#

def setup
  size(200, 200)
end

def draw
  background(204)
  line(0, 0, mouse_x, height)
  line(width, 0, 0, mouse_y)
end

def mouse_pressed
  save("line.tif")
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
ruby-processing-2.4.4 samples/processing_app/topics/file_io/save_one_image.rb
ruby-processing-2.4.3 samples/processing_app/topics/file_io/save_one_image.rb
ruby-processing-2.4.2 samples/processing_app/topics/file_io/save_one_image.rb
ruby-processing-2.4.1 samples/processing_app/topics/file_io/save_one_image.rb