Saving a .png that is bigger than the screen

BlitzMax Forums/BlitzMax Beginners Area/Saving a .png that is bigger than the screen

Juiceter(Posted 2016) [#1]
This was easy in Blitz Basic. Not sure if it is here, because you can't copy buffers, you have to draw everything to the screen.

So you have to draw it to use setscale (i want to shrink or expand the png) - but it is too big for the screen, so you can't save the area that isn't drawn to the screen! Or can you?

Is there a way around it (such as copying from the loaded graphic without drawing it to the backbuffer, but scaled differently)?


Kryzon(Posted 2016) [#2]
"such as copying from the loaded graphic without drawing it to the backbuffer, but scaled differently" -- try this:
Local myPixmap:TPixmap = LoadPixmap( "... .png" )

Local scaleX:Float	= 2.0 '200% increase.
Local scaleY:Float	= 1.5 '150% increase.

Local newWidth:Int	= Int( myPixmap.width * scaleX )
Local newHeight:Int	= Int( myPixmap.height * scaleY )

Local scaledPixmap:TPixmap = ResizePixmap( myPixmap, newWidth, newHeight )
SavePixmapPNG( scaledPixmap, "... .png", 9 )



Hardcoal(Posted 2016) [#3]
I sure love programming! Its like having Gods power.


Juiceter(Posted 2016) [#4]
Thanks K - i'll give that a try. Resizepixmap - must have missed that. Mind you, there are so many more commands to max...