Sha256: 075bc60acd4bb9138d0b01c398481d29203858e4b94ee0f6c0121c1dff7b983c

Contents?: true

Size: 726 Bytes

Versions: 35

Compression:

Stored size: 726 Bytes

Contents

#!/usr/bin/env ruby
=begin
  flip.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: flip.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))

# Horizontal
dst = src.flip(true)
vbox.add(Gtk::Image.new(pixbuf: dst))

# Vertical
dst2 = src.flip(false)
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

35 entries across 35 versions & 1 rubygems

Version Path
gdk_pixbuf2-4.2.4 sample/flip.rb
gdk_pixbuf2-4.2.3 sample/flip.rb
gdk_pixbuf2-4.2.2 sample/flip.rb
gdk_pixbuf2-4.2.1 sample/flip.rb
gdk_pixbuf2-4.2.0 sample/flip.rb
gdk_pixbuf2-4.1.9 sample/flip.rb
gdk_pixbuf2-4.1.8 sample/flip.rb
gdk_pixbuf2-4.1.7 sample/flip.rb
gdk_pixbuf2-4.1.6 sample/flip.rb
gdk_pixbuf2-4.1.5 sample/flip.rb
gdk_pixbuf2-4.1.4 sample/flip.rb
gdk_pixbuf2-4.1.3 sample/flip.rb
gdk_pixbuf2-4.1.2 sample/flip.rb
gdk_pixbuf2-4.1.1 sample/flip.rb
gdk_pixbuf2-4.1.0 sample/flip.rb
gdk_pixbuf2-4.0.9 sample/flip.rb
gdk_pixbuf2-4.0.8 sample/flip.rb
gdk_pixbuf2-4.0.7 sample/flip.rb
gdk_pixbuf2-4.0.6 sample/flip.rb
gdk_pixbuf2-4.0.5 sample/flip.rb