Sha256: b65aa55a0d9d3217b64fe04c7e79bb08cac61d7e20584c614aa94a4452e79f1a

Contents?: true

Size: 891 Bytes

Versions: 110

Compression:

Stored size: 891 Bytes

Contents

=begin
  pixdata.rb - Ruby/GdkPixbuf sample script.

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

  $Id: pixdata.rb,v 1.2 2006/06/17 14:38:08 mutoh Exp $
=end
require 'gtk2'

r_xpm = [
      "10 10 3 1", 
      "   c None", 
      ".  c #FE0B0B", 
      "+  c #FFFFFF", 
      "+.......++",   
      "+..    ..+",
      "+..    ..+",
      "+..   ...+",
      "+.......++",
      "+.....++++",
      "+..++..+++",
      "+..++...++",
      "+..+++...+",
      "+..++++..+"]     

pixbuf = Gdk::Pixbuf.new(r_xpm)
pixdata = Gdk::Pixdata.from_pixbuf(pixbuf, false)

#Serialize data
p data = pixdata.serialize

#Deserialize data
pixdata = Gdk::Pixdata.deserialize(data)
pixbuf2 = pixdata.to_pixbuf(false)

dst = pixbuf2.scale(300, 300, Gdk::Pixbuf::INTERP_HYPER)
Gtk::Window.new.add(Gtk::Image.new(dst)).show_all
Gtk.main

Version data entries

110 entries across 110 versions & 2 rubygems

Version Path
gdk_pixbuf2-2.1.0-x86-mingw32 sample/pixdata.rb
gdk_pixbuf2-2.1.0 sample/pixdata.rb
gdk_pixbuf2-2.0.3-x86-mingw32 sample/pixdata.rb
gdk_pixbuf2-2.0.3 sample/pixdata.rb
gdk_pixbuf2-2.0.2-x86-mingw32 sample/pixdata.rb
gdk_pixbuf2-2.0.2 sample/pixdata.rb
gdk_pixbuf2-2.0.1-x86-mingw32 sample/pixdata.rb
gdk_pixbuf2-2.0.1 sample/pixdata.rb
gdk_pixbuf2-2.0.0-x86-mingw32 sample/pixdata.rb
gdk_pixbuf2-2.0.0 sample/pixdata.rb
gdk_pixbuf2-1.2.6-x86-mingw32 sample/pixdata.rb
gdk_pixbuf2-1.2.6 sample/pixdata.rb
gdk_pixbuf2-1.2.5-x86-mingw32 sample/pixdata.rb
gdk_pixbuf2-1.2.5 sample/pixdata.rb
gdk_pixbuf2-1.2.4-x86-mingw32 sample/pixdata.rb
gdk_pixbuf2-1.2.4 sample/pixdata.rb
gdk_pixbuf2-1.2.3 sample/pixdata.rb
gdk_pixbuf2-1.2.3-x86-mingw32 sample/pixdata.rb
gdk_pixbuf2-1.2.2-x86-mingw32 sample/pixdata.rb
gdk_pixbuf2-1.2.2 sample/pixdata.rb