Fastest Resize Image?

BlitzMax Forums/BlitzMax Programming/Fastest Resize Image?

My problem is I'm writing a fully resizeable windows gui app.
In this app I have a native 340x340 pixel image displayed in a canvas.
As soon as I resize the window you can see how each element is changed in shape. This looks a bit ugly. So I'm searching for a way to speed this up.

' Done on EVENT_WINDOWSIZE
ClientW=ClientWidth(MyWindow)  
ClientH=ClientHeight(MyWindow)
CanW=(ClientW-800)/2  
CanH=(ClientH-401)/2
' ^^these vars are used more than one time, so I store them in vars

CoverIMG=ResizeImage:TImage(CoverIMG,(340+CanW),(340+CanH))   
SetGadgetShape(MyCanvas:TGadget,ClientW-345-CanW,5,(340+CanW),(340+CanH))
(...setting other shapes...) 


I have uploaded an alpha app, so you can see for yourself.
I'm not that good at explaining.

http://grisu.roxr.com/dfa.zip (2.4 MB)


If it is possible to use setscale for this I'm not sure how to calculate the new image scalefactor so that it fits the canvas size.