DrawRotatedImage
DrawRotatedImage ImageNumber, Xpos, Ypos, Angle#, ScaleX, ScaleY, HandleX, HandleY, TransparentFlag
 
Parameters:

    ImageNumber = The identifier of this image
    Xpos = The X coordinate to draw the image at
    Ypos = The Y coordinate 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
    TransparentFlag = Render the image with or without transparency (0=solid, 1=transparent)
Returns: NONE
 

     The DrawRotatedImage command renders a rotated image to the current surface. Generally the current surface will be the screen, but you can draw rotated images directly onto another images also.


Transparent Flags:


      0 = Solid
      1 = Transparent (uses mask colour or alpha channel on AFX images)
      8 = Solid With Bilinear Filter
      9 = Transparent With Bilinear Filter (uses mask colour or alpha channel on AFX images)



FACTS:


     * DrawRotatedImage can react to some InkModes. Such as AlphaBlend, Alpha50, AlphaSub, AlphaAdd.

     * DrawRotatedImage renders the image to the current surface, except when the user either CaptureToScene, or CaptureToWorld are activated. In either situation the render request will be added to the scene or world queues.

      * Image Rotation is done via the computers cpu, rather than a graphics card. So it should be used sparingly.

      * Note: For best rotation performance, your image should been previously prepared as an FX image using the PrepareFxImage,LoadFxImage,NewFxImage etc.. commands.





 
Example Source: Download This Example
; Enable Screen Vsync
  ScreenVsync on
  SetFPS 75
  
  
; Load the Ship image into image slot #1
  MyImage=LoadNewFxImage(ProgramDir$()+"Help/Commands/Media/ship.bmp")
  
; Get the Width of this image and use it as the images size
  Size=GetImageWidth(MyIMage)
  
  
; =============================
; Start a main loop
; =============================
  Do
     
   ; Clear the screen to a dark red colour
     Cls RGB(100,40,30)
     
   ; Read the mouses position
     mx#=MouseX()
     my#=MouseY()
     
     
   ; Space KEy To Change Draw Mode
     
     If SpaceKey()
        Select DrawMode
            Case 0  :Drawmode=1
            Case 1  :Drawmode=8
            Case 8  :Drawmode=9
            Case 9  :Drawmode=0
        EndSelect
        FlushKeys
     EndIf
     
     LockBuffer
     For angle#=0 To 359 Step 60
        x#=mx#+CosRadius(baseangle#+angle#,200)
        Y#=my#+SinRadius(baseangle#+angle#,200)
      ; Draw the rotated image to the screen.
        DrawRotatedImage MyImage,x#,y#,RotAngle#,2,2,size/-2,size/-2,DrawMode
     Next
     UnLockBuffer
     
     
   ; Draw Message at the mouse position
     Print "Drawing Rotated Image - Press Space To Change"
     Print "Current drawMode:"+Str$(drawMode)
     
     RotAngle#=WrapAngle(RotAngle#,2)
     
     Baseangle#=WrapAngle(BaseAngle#,1)
     
   ; Display the screen and loop until the users presses the ESC key.
     Sync
  Loop
  
  
 
Related Info: DrawAlphaImage | DrawImage | GridImage | LoadAFxImage | LoadFxImage | LoadImage | PrepareAFXimage | PrepareFXImage | TileImage :
 


(c) Copyright 2002 - 2024 - Kevin Picone - PlayBASIC.com