/[escript]/trunk/doc/examples/pyvisi/logo.py
ViewVC logotype

Diff of /trunk/doc/examples/pyvisi/logo.py

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

revision 1147 by ksteube, Wed May 16 06:39:11 2007 UTC revision 1148 by jongui, Wed May 16 22:45:33 2007 UTC
# Line 2  Line 2 
2  from esys.pyvisi import Scene, ImageReader, Logo  from esys.pyvisi import Scene, ImageReader, Logo
3  from esys.pyvisi import LocalPosition  from esys.pyvisi import LocalPosition
4  from esys.pyvisi.constant import *  from esys.pyvisi.constant import *
5    import os
6    
7  PYVISI_EXAMPLE_MESHES_PATH = "data_meshes/"  PYVISI_EXAMPLE_MESHES_PATH = "data_meshes"
8  PYVISI_EXAMPLE_IMAGES_PATH = "data_sample_images/"  PYVISI_EXAMPLE_IMAGES_PATH = "data_sample_images"
9  X_SIZE = 600  X_SIZE = 600
10  Y_SIZE = 300  Y_SIZE = 300
11    
# Line 18  s = Scene(renderer = JPG_RENDERER, num_v Line 19  s = Scene(renderer = JPG_RENDERER, num_v
19    
20  # Create an ImageReader (in place of DataCollector).  # Create an ImageReader (in place of DataCollector).
21  ir = ImageReader(ImageFormat.JPG)  ir = ImageReader(ImageFormat.JPG)
22  ir.setImageName(image_name =  PYVISI_EXAMPLE_MESHES_PATH + LOAD_LOGO_NAME)  ir.setImageName(image_name =  os.path.join(PYVISI_EXAMPLE_MESHES_PATH, \
23            LOAD_LOGO_NAME))
24    
25  # Create an Image.  # Create an Image.
26  l = Logo(scene = s, image_reader = ir, viewport = Viewport.SOUTH_WEST)  l = Logo(scene = s, image_reader = ir, viewport = Viewport.SOUTH_WEST)
# Line 26  l.setPosition(position = LocalPosition(1 Line 28  l.setPosition(position = LocalPosition(1
28  l.setSize(size = 0.7)  l.setSize(size = 0.7)
29    
30  # Render the object.  # Render the object.
31  s.render(PYVISI_EXAMPLE_IMAGES_PATH + SAVE_IMAGE_NAME)  s.render(image_name = os.path.join(PYVISI_EXAMPLE_IMAGES_PATH, SAVE_IMAGE_NAME))
32    

Legend:
Removed from v.1147  
changed lines
  Added in v.1148

  ViewVC Help
Powered by ViewVC 1.1.26