lib/chunky_png/canvas.rb
# Replaces the image, given a new width, new height, and a new pixel array.
Replaces the image, given a new width, new height, and a new pixel array.
Replaces the image given a new width new height and a new pixel array .
def replace_canvas!(new_width, new_height, new_pixels)
      unless new_pixels.length == new_width * new_height
        raise ArgumentError, "The provided pixel array should have #{new_width * new_height} items"
      end
      @width, @height, @pixels = new_width, new_height, new_pixels
      self
    end
def replace_canvas! ( new_width , new_height , new_pixels ) unless new_pixels . length == new_width * new_height raise ArgumentError , "The provided pixel array should have #{new_width * new_height} items" end @width , @height , @pixels = new_width , new_height , new_pixels self end
Replaces the image, given a new width, new height, and a new pixel array.
Replaces the image given a new width new height and a new pixel array .
new_width
<not_specific>
new_height
<not_specific>
new_pixels
<not_specific>