frameit/lib/frameit/editor.rb
# puts the screenshot into the frame
puts the screenshot into the frame
puts the screenshot into the frame
def put_into_frame
      rotation = self.rotation_for_device_orientation
      frame.rotate(-rotation)
      @image.rotate(-rotation)
      @image = frame.composite(image, "png") do |c|
        c.compose("DstOver")
        c.geometry(offset['offset'])
      end
      frame.rotate(rotation)
      @image.rotate(rotation)
    end
def put_into_frame rotation = self . rotation_for_device_orientation frame . rotate ( - rotation ) @image . rotate ( - rotation ) @image = frame . composite ( image , "png" ) do | c | c . compose ( "DstOver" ) c . geometry ( offset [ 'offset' ] ) end frame . rotate ( rotation ) @image . rotate ( rotation ) end
puts the screenshot into the frame
puts the screenshot into the frame
# We have to rotate the screenshot, since the offset information is for portrait # only. Instead of doing the calculations ourselves, it's much easier to let # imagemagick do the hard lifting for landscape screenshots # Revert the rotation from above