Sha256: c7ba270938b3988379c9511f919381c4853e4ad63ec6e6935181fec6d102f397

Contents?: true

Size: 811 Bytes

Versions: 90

Compression:

Stored size: 811 Bytes

Contents

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

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

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

require 'gtk2'


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

if str = Gtk.check_version(2, 6, 0)
  puts "This sample requires GTK+ 2.6.0 or later"
  puts str
  exit
end

vbox = Gtk::VBox.new

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

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

dst2 = src.rotate(:upsidedown)
vbox.add(Gtk::Image.new(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

90 entries across 82 versions & 2 rubygems

Version Path
gdk_pixbuf2-3.4.1 sample/rotate.rb
gdk_pixbuf2-3.4.0 sample/rotate.rb
gdk_pixbuf2-3.3.9 sample/rotate.rb
gdk_pixbuf2-3.3.8 sample/rotate.rb
gdk_pixbuf2-3.3.7 sample/rotate.rb
gdk_pixbuf2-3.3.6 sample/rotate.rb
gdk_pixbuf2-3.3.5 sample/rotate.rb
gdk_pixbuf2-3.3.4 sample/rotate.rb
gdk_pixbuf2-3.3.3 sample/rotate.rb
gdk_pixbuf2-3.3.2 sample/rotate.rb
gdk_pixbuf2-3.3.1 sample/rotate.rb
gdk_pixbuf2-3.3.0 sample/rotate.rb
gdk_pixbuf2-3.2.9-x64-mingw32 sample/rotate.rb
gdk_pixbuf2-3.2.9-x86-mingw32 sample/rotate.rb
gdk_pixbuf2-3.2.9 sample/rotate.rb
gdk_pixbuf2-3.2.8-x64-mingw32 sample/rotate.rb
gdk_pixbuf2-3.2.8-x86-mingw32 sample/rotate.rb
gdk_pixbuf2-3.2.8 sample/rotate.rb
gdk_pixbuf2-3.2.7-x86-mingw32 sample/rotate.rb
gdk_pixbuf2-3.2.7-x64-mingw32 sample/rotate.rb