Sha256: f736336615dd5e333a828f8c702edb516edc4d6f3f945d0b3f93a53bf83ed205

Contents?: true

Size: 729 Bytes

Versions: 40

Compression:

Stored size: 729 Bytes

Contents

#!/usr/bin/env ruby
=begin
  rotate.rb - Ruby/GdkPixbuf sample script.

  Copyright (c) 2005-2020 Ruby-GNOME Project Team
  This program is licenced under the same licence as Ruby-GNOME.

  $Id: rotate.rb,v 1.3 2006/06/17 14:38:08 mutoh Exp $
=end

require 'gtk3'

filename = ARGV[0]
unless filename
  puts "ruby #{$0} filename"
  exit(1)
end

vbox = Gtk::Box.new(:vertical)

src =  GdkPixbuf::Pixbuf.new(file: filename)
vbox.add(Gtk::Image.new(pixbuf: src))

dst = src.rotate(:counterclockwise)
vbox.add(Gtk::Image.new(pixbuf: dst))

dst2 = src.rotate(:upsidedown)
vbox.add(Gtk::Image.new(pixbuf: dst2))

window = Gtk::Window.new
window.signal_connect('delete-event') do
  Gtk.main_quit
end

window.add(vbox).show_all

Gtk.main

Version data entries

40 entries across 40 versions & 1 rubygems

Version Path
gdk_pixbuf2-4.0.9 sample/rotate.rb
gdk_pixbuf2-4.0.8 sample/rotate.rb
gdk_pixbuf2-4.0.7 sample/rotate.rb
gdk_pixbuf2-4.0.6 sample/rotate.rb
gdk_pixbuf2-4.0.5 sample/rotate.rb
gdk_pixbuf2-4.0.4 sample/rotate.rb
gdk_pixbuf2-4.0.3 sample/rotate.rb
gdk_pixbuf2-4.0.2 sample/rotate.rb
gdk_pixbuf2-4.0.1 sample/rotate.rb
gdk_pixbuf2-4.0.0 sample/rotate.rb
gdk_pixbuf2-3.5.1 sample/rotate.rb
gdk_pixbuf2-3.5.0 sample/rotate.rb
gdk_pixbuf2-3.4.9 sample/rotate.rb
gdk_pixbuf2-3.4.8 sample/rotate.rb
gdk_pixbuf2-3.4.7 sample/rotate.rb
gdk_pixbuf2-3.4.6 sample/rotate.rb
gdk_pixbuf2-3.4.5 sample/rotate.rb
gdk_pixbuf2-3.4.4 sample/rotate.rb
gdk_pixbuf2-3.4.3 sample/rotate.rb
gdk_pixbuf2-3.4.2 sample/rotate.rb