/[gzz]/gzz/gfx/demo/xupdf.py
ViewVC logotype

Diff of /gzz/gfx/demo/xupdf.py

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.55 by tjl, Wed Oct 23 19:50:17 2002 UTC revision 1.56 by jvk, Sun Dec 1 15:20:28 2002 UTC
# Line 11  from jarray import array, zeros Line 11  from jarray import array, zeros
11  from gzz.view import pagespanview  from gzz.view import pagespanview
12  pagespanview.window = w  pagespanview.window = w
13    
14    from gfx.libutil import saveanim
15    
16  # Now, this is the start of the REAL demo, the one  # Now, this is the start of the REAL demo, the one
17  # with Xanadu links between PDF and text.  # with Xanadu links between PDF and text.
18    
# Line 77  def globalkey(key): Line 79  def globalkey(key):
79      if '1' <= key <= '9':      if '1' <= key <= '9':
80          currentScene.moveToCell(cells[ord(key) - ord('1')])          currentScene.moveToCell(cells[ord(key) - ord('1')])
81    
82        if key == "Print": makeScreenshots()
83    
84    def r(sc, filename):
85        vs = w.createVobScene()
86        sc.scene(vs)
87        w.renderStill(vs, 0)
88        saveanim.saveframe(filename, w)
89    
90    def makeScreenshots():
91        ps = gzz.view.xubuoy.XuPDFScene_PDFContext(xuspace)
92        #w.setLocation(0,0,640,480)
93    
94        for i in range(0,24):
95            ps.moveToCell(cells[1], .1 * i, 0)
96            r(ps, "tmpfilm/xupdf%03i.jpg" % i)
97    
98        saveanim.encodefilm("tmpfilm/xupdf\\*.jpg", "xupdffilm.avi")
99    
100  currentScene = gzz.view.xubuoy.XuPDFScene_PDFContext(xuspace)  currentScene = gzz.view.xubuoy.XuPDFScene_PDFContext(xuspace)
101  gzz.view.xubuoy.replaceNewScene = replaceNewScene  gzz.view.xubuoy.replaceNewScene = replaceNewScene
102  currentScene.moveToCell(cells[1], 0, 0, redraw=1)  currentScene.moveToCell(cells[1], 0, 0, redraw=1)

Legend:
Removed from v.1.55  
changed lines
  Added in v.1.56

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26