2004年03月27日 星期六 17:14
我最近作一个图象分析系统,要在框架中显示缩略图象,但是打开文件后只能显示一与图象大小相等的白色区域,不知为什么,但如果实现确定图象文件,并且在程序初始化中打开就能正常显示,实在痛苦,希望大家帮忙!跪! 我写的部分代码如下: def get_image(): lbl=Label(frame_image) lbl.place(relx=0.5,rely=0.48,anchor=CENTER) im=Image.open(filename.get()) im.thumbnail((400,400)) img=ImageTk.PhotoImage(im) lbl['image']=img #其中filename为一与Entry绑定的StringVar ,用来得到图象文件名 =============================================== 诺基亚铃声 http://sms.tom.com/index2.php?inc=3&type;=24 摩托罗拉铃声 http://sms.tom.com/index2.php?inc=3&type;=26 西门子铃声 http://sms.tom.com/index2.php?inc=3&type;=25 诺基亚小图 http://sms.tom.com/index2.php?inc=2 诺基亚大图 http://sms.tom.com/index2.php?inc=2&type;=3740 西门子图片 http://sms.tom.com/index2.php?inc=2&type;=30 手机点歌 http://sms.tom.com/index2.php?inc=song ===============================================
2004年03月27日 星期六 19:17
小雷,您好! 你的图象是什么后缀的阿! 我用qq的图片测试过没有问题阿! 我没事写的东东看看把 ======= 2004-03-27 17:14:00 您在来信中写道:======= >我最近作一个图象分析系统,要在框架中显示缩略图象,但是打开文件后只能显示一与图象大小相等的白色区域,不知为什么,但如果实现确定图象文件,并且在程序初始化中打开就能正常显示,实在痛苦,希望大家帮忙!跪! >我写的部分代码如下: >def get_image(): >lbl=Label(frame_image) >lbl.place(relx=0.5,rely=0.48,anchor=CENTER) >im=Image.open(filename.get()) >im.thumbnail((400,400)) >img=ImageTk.PhotoImage(im) >lbl['image']=img >#其中filename为一与Entry绑定的StringVar ,用来得到图象文件名 > > >=============================================== >诺基亚铃声 http://sms.tom.com/index2.php?inc=3&type;=24 >摩托罗拉铃声 http://sms.tom.com/index2.php?inc=3&type;=26 >西门子铃声 http://sms.tom.com/index2.php?inc=3&type;=25 > >诺基亚小图 http://sms.tom.com/index2.php?inc=2 >诺基亚大图 http://sms.tom.com/index2.php?inc=2&type;=3740 >西门子图片 http://sms.tom.com/index2.php?inc=2&type;=30 > >手机点歌 http://sms.tom.com/index2.php?inc=song >===============================================_______________________________________________ >python-chinese list >python-chinese at lists.python.cn >http://python.cn/mailman/listinfo/python-chinese = = = = = = = = = = = = = = = = = = = = 致 礼! leaof leaof at 21cn.com 2004-03-27 -------------- next part -------------- A non-text attachment was scrubbed... Name: python.rar Type: application/octet-stream Size: 5714 bytes Desc: not available Url : http://lists.exoweb.net/pipermail/python-chinese/attachments/20040327/f4f7a9a5/python.obj -------------- next part -------------- A non-text attachment was scrubbed... Name: face-3.gif Type: image/gif Size: 842 bytes Desc: not available Url : http://lists.exoweb.net/pipermail/python-chinese/attachments/20040327/f4f7a9a5/face-3.gif
2004年03月30日 星期二 19:49
leaof: ÄãºÃ£¬Ä㸽¼þÖеijÌÐòÎÒ´òé_¿´ÁËһϣ¬ÔÚ´òé_rï@ʾ¡°The encoding 'Unknown encoding cp936' is not known to this python installation. The file may not display correctly',Õ½ÌÊÇʲôÔÒò£¿ ÎÒÔÚß\Ðд˳ÌÐòr£¬ï@ʾ¡°File "C:\WINDOWS\system32\export\python\lib\lib-tk\Tkinter.py", line 1345, in __call__ return self.func(*args) File "C:\WINDOWS\system32\export\python\lib\idlelib\ScriptBinding.py", line 135, in run_module_event code = self.checksyntax(filename) File "C:\WINDOWS\system32\export\python\lib\idlelib\ScriptBinding.py", line 96, in checksyntax return compile(source, filename, "exec") MemoryError¡±Õ½ÌʲôÔÒò£¿ THANKS!!! ----- Original Message ----- From: "leaof" <leaof at 21cn.com> To: <python-chinese at lists.python.cn> Sent: Saturday, March 27, 2004 7:00 PM Subject: Re: [python-chinese]ÇóÖú£¡ÓйØFrameÖÐͼÏóµÄÏÔʾ£¡ СÀ×,ÄúºÃ£¡ ÄãµÄͼÏóÊÇʲôºó׺µÄ°¢£¡ ÎÒÓÃqqµÄͼƬ²âÊÔ¹ýûÓÐÎÊÌâ°¢£¡ ÎÒûÊÂдµÄ¶«¶«¿´¿´°Ñ ======= 2004-03-27 17:14:00 ÄúÔÚÀ´ÐÅÖÐдµÀ£º======= >ÎÒ×î½ü×÷Ò»¸öͼÏó·ÖÎöϵͳ£¬ÒªÔÚ¿ò¼ÜÖÐÏÔʾËõÂÔͼÏ󣬵«ÊÇ´ò¿ªÎļþºóÖ»ÄÜÏÔʾһ ÓëͼÏó´óСÏàµÈµÄ°×É«ÇøÓò£¬²»ÖªÎªÊ²Ã´£¬µ«Èç¹ûʵÏÖÈ·¶¨Í¼ÏóÎļþ£¬²¢ÇÒÔÚ³ÌÐò³õʼ »¯Öдò¿ª¾ÍÄÜÕý³£ÏÔʾ£¬ÊµÔÚÍ´¿à£¬Ï£Íû´ó¼Ò°ï棡¹ò£¡ >ÎÒдµÄ²¿·Ö´úÂëÈçÏ£º >def get_image(): >lbl=Label(frame_image) >lbl.place(relx=0.5,rely=0.48,anchor=CENTER) >im=Image.open(filename.get()) >im.thumbnail((400,400)) >img=ImageTk.PhotoImage(im) >lbl['image']=img >#ÆäÖÐfilenameΪһÓëEntry°ó¶¨µÄStringVar ,ÓÃÀ´µÃµ½Í¼ÏóÎļþÃû > > >=============================================== >ŵ»ùÑÇÁåÉù http://sms.tom.com/index2.php?inc=3&type;=24 >ĦÍÐÂÞÀÁåÉù http://sms.tom.com/index2.php?inc=3&type;=26 >Î÷ÃÅ×ÓÁåÉù http://sms.tom.com/index2.php?inc=3&type;=25 > >ŵ»ùÑÇСͼ http://sms.tom.com/index2.php?inc=2 >ŵ»ùÑÇ´óͼ http://sms.tom.com/index2.php?inc=2&type;=3740 >Î÷ÃÅ×ÓͼƬ http://sms.tom.com/index2.php?inc=2&type;=30 > >ÊÖ»úµã¸è http://sms.tom.com/index2.php?inc=song >===============================================____________________________ ___________________ >python-chinese list >python-chinese at lists.python.cn >http://python.cn/mailman/listinfo/python-chinese = = = = = = = = = = = = = = = = = = = = ¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡Ö Àñ£¡ ¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡leaof ¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡leaof at 21cn.com ¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡2004-03-27 ---------------------------------------------------------------------------- ---- > _______________________________________________ > python-chinese list > python-chinese at lists.python.cn > http://python.cn/mailman/listinfo/python-chinese >
Zeuux © 2024
京ICP备05028076号