Class: RGhost::Gif

Inherits:
Image show all
Defined in:
lib/rghost/gif.rb

Overview

Loads GIF image from file

Examples

doc=Document.new doc.set Gif.new “../public/images/button.gif”, :x => 10, :y => 3 Using Image.for facade doc.set Image.for “../public/images/button.gif”, :x => 10, :y => 3 Using PsFacade or Document doc.image “images/button.gif”, :x => 10, :y => 3 Using zoom of the 200 percent doc.image “images/button.gif”, :zoom => 200

Options

  • :x and :y - Coordinates to position.

  • :rotate - Angle to image rotation if there is one.

  • :zoom - Resize proportionally the image

Constant Summary

Constants inherited from Image

Image::DEFAULT_OPTIONS

Instance Method Summary collapse

Methods inherited from Image

for, #initialize

Methods inherited from PsObject

#<<, #call, #graphic_scope, #initialize, #raw, #set, #to_s

Constructor Details

This class inherits a constructor from RGhost::Image

Instance Method Details

#psObject


25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# File 'lib/rghost/gif.rb', line 25

def ps
  s=@options[:zoom]/100.0
  
  g=RGhost::Graphic.new 
  
  params=RGhost::Function.new(:gif_params)
  params.set RGhost::Cursor.translate(@options)  
  params.set RGhost::Cursor.rotate(@options[:rotate])
  params.set RGhost::Scale.new(s,s) 
  
  g.set params
  g.set RGhost::PsObject.new("(#{@file}) viewGIF")  
  g.ps

end