Created
June 22, 2016 13:27
-
-
Save anonymous/cd16dab4864640d6dbb9be8bff6ab54e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def build_canvas (canvas_width, canvas_height, bgcolor = "#ffffff") | |
canvas_fname = "canvas-#{@now}" | |
canvas = Image.new(canvas_width, canvas_height) { self.background_color = bgcolor } | |
canvas.write("tmp/#{canvas_fname}.png") | |
Image.read("tmp/#{canvas_fname}.png").first | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment