Class: RGhost::Jpeg

Inherits:
Image 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

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
# 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.ps

end