Commit before breaking everything
[matches/honours.git] / research / transmission_spectroscopy / simulator / pgu-0.18 / build / scripts-3.2 / tganew
1 #!C:\Python32\python.exe
2 """<title>a tga creator</title>
3 <pre>usage: tganew fname.tga w h
4
5 options:
6   -h, --help  show this help message and exit
7
8 example:
9 tganew tiles.tga 256 256
10 </pre>
11 """
12
13 from optparse import OptionParser
14
15 usage = "usage: %prog fname.tga w h"
16 parser = OptionParser(usage)
17 (opts,args) = parser.parse_args()
18 if len(args) != 3:
19         parser.error("incorrect number of arguments")
20
21 try: fname,w,h = args[0],int(args[1]),int(args[2])
22 except: parser.error("width and height must be integers")
23 if w < 1 or h < 1: parser.error("width and height must be greater than 0")
24
25 import pygame
26 from pygame.locals import *
27
28 s = pygame.Surface((w,h),SWSURFACE|SRCALPHA,32)
29 s.fill((0,0,0,0))
30
31 pygame.image.save(s,fname)
32 # vim: set filetype=python sts=4 sw=4 noet si :

UCC git Repository :: git.ucc.asn.au