示例#1
0
 def from_file(self, filename, translate=False):
     """Load graphic from an image file."""
     if filename[-4:].lower() == '.lmp':
         self.data = util.readfile(filename)
     else:
         im = Image.open(filename)
         self.from_Image(im, translate)
示例#2
0
 def from_file(self, filename, translate=False):
     """Load graphic from an image file."""
     if filename[-4:].lower() == '.lmp':
         self.data = util.readfile(filename)
     else:
         im = Image.open(filename)
         self.from_Image(im, translate)
示例#3
0
 def from_file(self, source):
     """Load data from a file. Source may be a path name string
     or a file-like object (with a `write` method)."""
     self.data = util.readfile(source)
示例#4
0
 def from_file(self, source):
     """Load data from a file. Source may be a path name string
     or a file-like object (with a `write` method)."""
     self.data = util.readfile(source)