Mark's Coding Creations
Rotate Image
Home
Kaleidascope
Gouraud Ellipses
Gouraud Quads
Gouraud Triangles
Draw And Fill
Gouraud_Circles
Rotate Image

rotate_image.jpg

REM Project: Rotate_Image

`make image:
ink rgb(0,255,255),0
set cursor 50,75: print "Hello World!"

` get the image:
GET IMAGE 99,  50, 75, 150,  95,1

`stretch image and spin it:
for angle = 1 to 360 step 3
Draw_Rotated_Image(99,  350,250,  angle,   350,550,  50,10,   1, 0)
 wait  1
next angle
text 200,10, "To exit press the left mouse button"
wait mouse
   if mouseclick() = 2
   get image 1,0,0,640,480,1: save image "Rotate_Image.jpg",1 :wait 5000
   endif
end
 
 
`&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&n  function  &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
Function Draw_Rotated_Image(ImageNumber, Xpos, Ypos, Angle#,ScaleX, ScaleY,HandleX, HandleY, Backsave, Transparency)
Sprite 1, Xpos, Ypos, ImageNumber : paste Sprite 1, Xpos, Ypos
SET SPRITE 1, Backsave, Transparency
OFFSET SPRITE 1, HandleX, HandleY
stretch SPRITE  1, ScaleX, ScaleY
rotate sprite 1, Angle#
endfunction
`&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
 
`Parameters:
`    ImageNumber = The identifier of this image
`    Xpos = The X coord to draw the image at
`    Ypos = The Y coord to draw the image at
`    Angle# = The angle of the rotated image
`    ScaleX = A scaler that is applied to the width
`    ScaleY = A scaler that is applied to the height
 `   HandleX = X offset for rotations axis point
`    HandleY = Y offset for rotations axis point
`    Backsave flag = Will the image erase itself each time it moves?  (1= yes,  0 = no)
`    TransparentFlag = Render the image with or without transparency (0=solid, 1=transparent)