Sha256: 5f98ae72a857c36737f89c6088c4bd0da1226aaf5371656b03f3c34cf9a2f40b

Contents?: true

Size: 834 Bytes

Versions: 110

Compression:

Stored size: 834 Bytes

Contents

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

  Copyright (c) 2005,2006 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 =  Gdk::Pixbuf.new(filename)
vbox.add(Gtk::Image.new(src))

dst = src.rotate(Gdk::Pixbuf::ROTATE_COUNTERCLOCKWISE)
vbox.add(Gtk::Image.new(dst))

dst2 = src.rotate(Gdk::Pixbuf::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

110 entries across 110 versions & 2 rubygems

Version Path
gdk_pixbuf2-1.1.1-x86-mingw32 sample/rotate.rb
gdk_pixbuf2-1.1.1 sample/rotate.rb
gdk_pixbuf2-1.1.0-x86-mingw32 sample/rotate.rb
gdk_pixbuf2-1.1.0 sample/rotate.rb
gdk_pixbuf2-1.0.3-x86-mingw32 sample/rotate.rb
gdk_pixbuf2-1.0.3 sample/rotate.rb
gdk_pixbuf2-1.0.2-x86-mingw32 sample/rotate.rb
gdk_pixbuf2-1.0.2 sample/rotate.rb
gdk_pixbuf2-1.0.1 sample/rotate.rb
gdk_pixbuf2-1.0.1-x86-mingw32 sample/rotate.rb
gdk_pixbuf2-1.0.0-x86-mingw32 sample/rotate.rb
gdk_pixbuf2-1.0.0 sample/rotate.rb
gdk_pixbuf2-0.90.9 sample/rotate.rb
gdk_pixbuf2-0.90.9-x86-mingw32 sample/rotate.rb
gdk_pixbuf2-0.90.8-x86-mingw32 sample/rotate.rb
gdk_pixbuf2-0.90.8 sample/rotate.rb
gdk_pixbuf2-0.90.7-x86-mingw32 sample/rotate.rb
gdk_pixbuf2-0.90.7 sample/rotate.rb
gdk_pixbuf2-0.90.6 sample/rotate.rb
gdk_pixbuf2-0.90.6-x86-mingw32 sample/rotate.rb