I have this script, which reads from a 32x32 dds file.
import pyglet
image = pyglet.image.load('char_2.dds')
tex = image.get_texture()
tex.width = 48
tex.height = 64
sprite = pyglet.sprite.Sprite(tex)
window = pyglet.window.Window()
@window.event
def on_draw():
sprite.draw()
pyglet.app.run()
This correctly scales the image to 48x64 and draws it to the window. How do
I get the raw pixel data that was drawn to the window? I've been googling
this for hours and have been unable to find a solution. I'm not even
interested in drawing to the window, or using the sprite class at all, but
I was unable to find any examples at all of how to upscale an image with
independent scale values for x and y. This is the closest I've been able to
get to an expected end result, but I can only get it in the window, I have
no idea how to get those pixel values. Did I miss something glaringly
obvious in the docs? All I want to do is scale an image and get the pixel
data, I don't want to draw anything to the window (or have any window at
all).
--
You received this message because you are subscribed to the Google Groups
"pyglet-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/pyglet-users.
For more options, visit https://groups.google.com/d/optout.