lib/chunky_png/canvas/operations.rb
# Draws a border around the image in place.
#
# @param [Integer] size The size of the border.
# @param [Integer] color The color of the border.
# @return [ChunkyPNG::Canvas] Returns itself with the border added.
# @see #border
Draws a border around the image in place.
Draws a border around the image in place .
def border!(size, color = ChunkyPNG::Color::BLACK)
        new_width  = width  + size * 2
        new_height = height + size * 2
        bg = Canvas.new(new_width, new_height, color).replace(self, size, size)
        replace_canvas!(new_width, new_height, bg.pixels)
      end
def border! ( size , color = ChunkyPNG :: Color :: BLACK ) new_width = width + size * 2 new_height = height + size * 2 bg = Canvas . new ( new_width , new_height , color ) . replace ( self , size , size ) replace_canvas! ( new_width , new_height , bg . pixels ) end
Draws a border around the image in place.
Draws a border around the image in place .
Returns itself with the border added.
Returns itself with the border added .
ChunkyPNG::Canvas
size
<not_specific>
color
<not_specific>
<not_specific>
color The color of the border.
color The color of the border .
see
None