Class: RGhost::Jpeg

Inherits:
Image
  • Object
show all
Defined in:
lib/rghost/jpeg.rb

Overview

Loads JPEG image from file

Examples

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

Options

  • :x and :y - Coordinates to position.

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

  • :zoom - Resize proportionally the image

Instance Method Summary collapse

Instance Method Details

#psObject



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

def ps
  #x=Units::parse( @options[:x] )
  #y=Units::parse( @options[:y] )
  
  g=RGhost::Graphic.new 
  g.set RGhost::Cursor.translate(@options)
    #set Cursor.translate()
  g.set RGhost::Cursor.rotate(@options[:rotate])
  g.set RGhost::Variable.new(:zoom,@options[:zoom]/100.0)
  g.set RGhost::PsObject.new("(#{@file}) viewJPEG")
  g

end