Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #102569

Re: How to resize an animated gif to fit the window

From Emile van Sebille <emile@fenx.com>
Newsgroups comp.lang.python
Subject Re: How to resize an animated gif to fit the window
Date 2016-02-05 15:54 -0800
Message-ID <mailman.27.1454716518.2317.python-list@python.org> (permalink)
References <3216251b-bab1-4946-9d9a-17eb13e76726@googlegroups.com>

Show all headers | View raw


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..
>

Back to comp.lang.python | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

How to resize an animated gif to fit the window kwekey@gmail.com - 2016-01-29 17:50 -0800
  Re: How to resize an animated gif to fit the window Emile van Sebille <emile@fenx.com> - 2016-02-05 15:54 -0800

csiph-web