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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1210 - (hide annotations)
Tue Jul 3 05:47:34 2007 UTC (14 years, 2 months ago) by jongui
File MIME type: text/x-python
File size: 996 byte(s)
Made some minor changes.
1 jongui 1203 """
2     Author: John Ngui, john.ngui@uq.edu.au
3     """
4    
5 ksteube 1147 # Import the necessary modules.
6     from esys.pyvisi import Scene, ImageReader, Logo
7     from esys.pyvisi import LocalPosition
8     from esys.pyvisi.constant import *
9 jongui 1148 import os
10 ksteube 1147
11 jongui 1148 PYVISI_EXAMPLE_MESHES_PATH = "data_meshes"
12     PYVISI_EXAMPLE_IMAGES_PATH = "data_sample_images"
13 ksteube 1147 X_SIZE = 600
14     Y_SIZE = 300
15    
16     LOAD_LOGO_NAME = "access_logo.jpg"
17     SAVE_IMAGE_NAME = "logo.jpg"
18     JPG_RENDERER = Renderer.ONLINE_JPG
19    
20     # Create a Scene.
21     s = Scene(renderer = JPG_RENDERER, num_viewport = 1, x_size = X_SIZE,
22     y_size = Y_SIZE)
23    
24     # Create an ImageReader (in place of DataCollector).
25     ir = ImageReader(ImageFormat.JPG)
26 jongui 1148 ir.setImageName(image_name = os.path.join(PYVISI_EXAMPLE_MESHES_PATH, \
27     LOAD_LOGO_NAME))
28 ksteube 1147
29 jongui 1210 # Create an Logo.
30 ksteube 1147 l = Logo(scene = s, image_reader = ir, viewport = Viewport.SOUTH_WEST)
31     l.setPosition(position = LocalPosition(10,10))
32     l.setSize(size = 0.7)
33    
34     # Render the object.
35 jongui 1148 s.render(image_name = os.path.join(PYVISI_EXAMPLE_IMAGES_PATH, SAVE_IMAGE_NAME))
36 ksteube 1147

  ViewVC Help
Powered by ViewVC 1.1.26