Resizing and Freeing Images

BlitzMax Forums/BlitzMax Beginners Area/Resizing and Freeing Images

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

It's close.
290ms Pixmap vs 360 Images with debug.
180ms Pixmap vs 220 Images without debug
The pixmap results in a cleaner image though.
Graphics 640,480
image = LoadImage("max.png",dynamicimage)
start_time=MilliSecs()
my_pixmap = LockImage(image)
xscale# = 1.5
yscale# = 1.5
my_new_pixmap = ResizePixmap (my_pixmap,ImageWidth(image)*xscale,ImageHeight(image)*yscale)
UnlockImage(image)
image=LoadImage(my_new_pixmap)
Cls
DrawImage image,0,0
DrawText "Resized : ",0,0
end_time=MilliSecs()
total_time = end_time - start_time
DrawText "Total_time : " + total_time,0,10
Flip
WaitKey()

Graphics 640,480
image = LoadImage("max.png",dynamicimage)
start_time=MilliSecs()
xscale# = 1.5
yscale# = 1.5
SetScale xscale,yscale
DrawImage image,0,0
my_image = CreateImage(ImageWidth(image)*xscale,ImageHeight(image)*yscale)
GrabImage(my_image,0,0)
Cls
SetScale 1.0,1.0
DrawImage my_image,0,0
DrawText "Resized : ",0,0
end_time=MilliSecs()
total_time = end_time - start_time
DrawText "Total_time : " + total_time,0,10
Flip
WaitKey() 

Any mistake spotting or optimisations most welcome