Resizing a pixmap not working?

BlitzMax Forums/BlitzMax Beginners Area/Resizing a pixmap not working?

Pete Carter(Posted 2009) [#1]

SetImageHandle(pix3,ImageWidth(pix3)/2,ImageHeight(pix3)/2)

SetRotation(-45)
SetScale(0.7,0.7)
SetImageHandle(pix3,0,0)
DrawImage(pix3,16,80)
SetRotation(0)
SetScale(1,1)

grabedimage:TPixmap = GrabPixmap:TPixmap(16,16,128,128)
ResizePixmap(grabedimage:TPixmap,128,64)
DrawPixmap(grabedimage:TPixmap,152,408)


it draws the tile that i grabbed at the original size with no scaling applied.

What im i doing wrong?


Pete Carter(Posted 2009) [#2]
Sorry must be early in the morning. ive got it working, it should be...

 
SetImageHandle(pix3,ImageWidth(pix3)/2,ImageHeight(pix3)/2)

SetRotation(-45)
SetScale(0.7,0.7)
SetImageHandle(pix3,0,0)
DrawImage(pix3,16,80)
SetRotation(0)
SetScale(1,1)

grabedimage:TPixmap = GrabPixmap:TPixmap(16,16,128,128)
resizedimage:TPixmap = ResizePixmap:TPixmap(grabedimage:TPixmap,128,64)
DrawPixmap(resizedImage:TPixmap,152,408)


man i need some coffee


Jesse(Posted 2009) [#3]
I kind of figured you would have looked at the source code by now.:)


TaskMaster(Posted 2009) [#4]
I don't think you need to SetImageHandle twice like that. It doesn't really do anything until you draw the image. So, you are actually using 0,0 as your handle when you do that draw.

The SetScale and SetRotation don't affect the image until you draw it (or do something else to it).