Path: csiph.com!weretis.net!feeder4.news.weretis.net!newsreader4.netcologne.de!news.netcologne.de!fu-berlin.de!uni-berlin.de!not-for-mail From: Emile van Sebille Newsgroups: comp.lang.python Subject: Re: How to resize an animated gif to fit the window Date: Fri, 5 Feb 2016 15:54:45 -0800 Lines: 39 Message-ID: References: <3216251b-bab1-4946-9d9a-17eb13e76726@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Trace: news.uni-berlin.de go0IqrnQ6ud4IcGSSrI9/wRrgB8j0wcZRPi1GEyE3gzw== Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.009 X-Spam-Evidence: '*H*': 0.98; '*S*': 0.00; 'subject:How': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'def': 0.13; 'skip:p 40': 0.15; 'googling': 0.16; 'received:80.91.229.3': 0.16; 'received:io': 0.16; 'received:plane.gmane.org': 0.16; 'received:psf.io': 0.16; 'resize': 0.16; 'wrote:': 0.16; 'windows': 0.20; 'code,': 0.23; 'fit': 0.23; 'select': 0.23; 'help.': 0.23; 'import': 0.24; 'header:In-Reply-To:1': 0.24; 'header:User-Agent:1': 0.26; 'header:X-Complaints-To:1': 0.26; 'finds': 0.29; 'str': 0.29; 'code:': 0.29; 'window': 0.30; 'url:python': 0.33; 'animation': 0.33; 'me?': 0.34; 'file': 0.34; 'skip:p 30': 0.35; 'but': 0.36; 'to:addr:python-list': 0.36; 'pm,': 0.36; 'subject:: ': 0.37; 'display': 0.37; 'received:org': 0.37; 'hi,': 0.38; 'subject:the': 0.39; 'to:addr:python.org': 0.40; 'some': 0.40; 'email addr:gmail.com': 0.62; 'charset:windows-1252': 0.62; 'received:12': 0.81; 'pyglet': 0.84; 'url:images': 0.85; 'stretch': 0.91 X-Injected-Via-Gmane: http://gmane.org/ X-Gmane-NNTP-Posting-Host: www.westernstatesglass.com User-Agent: Mozilla/5.0 (Windows NT 6.2; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 In-Reply-To: <3216251b-bab1-4946-9d9a-17eb13e76726@googlegroups.com> X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.21rc2 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Xref: csiph.com comp.lang.python:102569 Googling that finds https://cloud.google.com/appengine/docs/python/images/ which may be of some help. Emile On 1/29/2016 5:50 PM, kwekey@gmail.com wrote: > Hi, I am able to display animated gif using pyglet using below code, but I would like the image to stretch and fit the window as i resize the window. > Any one can help me? > > import pyglet > # pick an animated gif file you have in the working directory > > CODE: SELECT ALL > def animate(str): > ag_file = str > animation = pyglet.resource.animation(ag_file) > sprite = pyglet.sprite.Sprite(animation) > # create a window and set it to the image size > win = pyglet.window.Window(width=sprite.width, height=sprite.height) > > @win.event > def on_draw(): > win.clear() > sprite.draw() > > pyglet.app.run() > > animate("***.gif") > > > CODE: SELECT ALL > win = pyglet.window.Window(width=sprite.width, height=sprite.height) > > Above line will resize the window to fit the animated gif but i want it the other way, that is the gif to fit the windows size.. >