[Python编程(第4版)].(Programming.Python.4th.Edition).Mark.Lutz.文字版
For example, clicking the left and right mouse buttons will resize the image to the display’s height and width dimensions, respe ...
canvas’s scrollable (full) size is the image size, and the viewable area size is the minimum of the physical screen size or the ...
PyPhoto is implemented as the single file of Example 11-5, though it gets some utility for free by reusing the thumbnail generat ...
imgobj = Image.open(imgpath) # make new thumb imgobj.thumbnail(size, Image.ANTIALIAS) # best downsize filter imgobj.save(thumbpa ...
Example 11-5. PP4E\Gui\PIL\pyphoto1.py """ ############################################################################ PyPhoto ...
vbar = Scrollbar(container) hbar = Scrollbar(container, orient='horizontal') vbar.pack(side=RIGHT, fill=Y) # pack canvas after b ...
if imgwide <= scrwide and imghigh <= scrhigh: # too big for display? self.state('normal') # no: win size per img elif sys. ...
if filename: self.saveimage.save(filename) def onDirectoryOpen(event): """ open a new image directory in new pop up available in ...
link.pack(side=LEFT, expand=YES) canvas.create_window(colpos, rowpos, anchor=NW, window=link, width=linksize, height=linksize) c ...
PyView window’s default display on Windows 7, created by running the slideShow- Plus.py script we’ll see in Example 11-6 ahead. ...
and change the note file associated with the currently displayed photo. This additional set of widgets should look familiar—the ...
omitted (e.g., the File pull down menu and Quit button are gone). On the other hand, you get all of the rest of PyEdit’s functio ...
PyEdit really does assume control of the program’s window (including its title and window manager close button), and packing the ...
is destroyed independently. As is, this program must wrap the PyEdit classes with its WrapEditor in order to catch independent d ...
def init(self, parent, picdir, editclass, msecs=2000, size=Size): self.msecs = msecs self.editclass = editclass SlideShow.init(s ...
self.name.config(text=os.path.split(self.image[0])[1]) self.loadNote() def onScale(self, value): self.msecs = int(value) def onN ...
picdir = sys.argv[1] editstyle = TextEditorComponentMinimal if len(sys.argv) == 3: try: editstyle = [TextEditorMain, TextEditorM ...
self.beep = True self.drawn = None def makeWidgets(self): height, width = self.size self.canvas = Canvas(self, bg='white', heigh ...
if name == 'main': import sys if len(sys.argv) == 2: picdir = sys.argv[1] else: picdir = '../gifs' root = Tk() root.title('PyVie ...
cases, the slideshows run independently but are based on after events fired from the same single event loop in a single process. ...
«
34
35
36
37
38
39
40
41
42
43
»
Free download pdf