#Image resize does nothing ( Beta 7 and 8)

4 messages · Page 1 of 1 (latest)

formal gull
#

What in tarnation

    # Create the image
    
    print('xres=', xres, ' yres=',yres)             # xres=256 yres=50
    d.create(xres,yres, false, Image.FORMAT_RGBA8)
    
    print(d.get_height(),' ', d.get_width())    # 0 0

    d.resize(xres+5, yres)    
    print(d.get_height(),' ', d.get_width())    # 0 0
formal gull
#

Just checked the api docs too - thought resize might return the resized image but nope

cloud orchid
#

Image create(width: int, height: int, use_mipmaps: bool, format: Format) static

Creates an empty image of given size and format. See Format constants. If use_mipmaps is true, then generate mipmaps for this image. See the generate_mipmaps().

if you did Image.new() for d - d.create doesn't make an image in d - it creates a new image and returns it - which you do not store here

#

though why it doesn't modify the size is still questionable (perhaps because there's no data?)