RotateImage.htm 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. <html>
  2. <head>
  3. <title>Blitz3D Docs</title>
  4. <link rel=stylesheet href=../css/commands.css type=text/css>
  5. </head>
  6. <body>
  7. <h1>RotateImage image,value#</h1>
  8. <h1>Parameters</h1>
  9. <table>
  10. <tr>
  11. <td>
  12. image = variable containing the image handle <br />
  13. value# = floating number from 0 to 360 degrees
  14. </td>
  15. </tr>
  16. </table>
  17. <h1>Description</h1>
  18. <table>
  19. <tr>
  20. <td>
  21. I'm going to start this description off with: <br />
  22. <br />
  23. This command is not fast enough to render rotations in real time! <br />
  24. <br />
  25. Now, the purpose of this command is to rotate an image a specified number of degrees. Since it is slow, you will need to pre-calculate rotated images with this command. This means, before the program actually displays the images you rotate, you will want to rotate them ahead of time. <br />
  26. <br />
  27. This command automatically dithers/anti-aliases the rotated graphic image, so it might mess with your transparency. To avoid this issue, use the TFormFilter command. This will render the rotated images with bi-linear filtering. <br />
  28. <br />
  29. I'm going to end this command with: <br />
  30. <br />
  31. This command is not fast enough to render rotations in real time!
  32. </td>
  33. </tr>
  34. </table>
  35. <h1><a href=../2d_examples/RotateImage.bb>Example</a></h1>
  36. <table>
  37. <tr>
  38. <td>
  39. ; RotateImage/TFormFilter Example <br />
  40. <br />
  41. ; Turn on graphics mode <br />
  42. Graphics 640,480,16 <br />
  43. <br />
  44. ; Change the 0 to a 1 to see the difference <br />
  45. ; between filter on and off. <br />
  46. TFormFilter 0 <br />
  47. <br />
  48. ; Create new empty graphic to store our circle in <br />
  49. gfxBox=CreateImage(50,50) <br />
  50. <br />
  51. ; Draw the box image <br />
  52. ; Set drawing operations to point to our new empty graphic <br />
  53. SetBuffer ImageBuffer(gfxBox) <br />
  54. Color 255,0,0 <br />
  55. ; Note the extra space between the box and the edge of the graphic <br />
  56. Rect 10,10,30,30,1 <br />
  57. SetBuffer FrontBuffer() <br />
  58. <br />
  59. While Not KeyHit(1) <br />
  60. ; Make a copy of the image so we are always using a fresh one each time <br />
  61. ; we rotate it. <br />
  62. gfxTemp=CopyImage(gfxBox) <br />
  63. ; Rotate it a random value and draw it at a random location <br />
  64. RotateImage gfxTemp,Rnd(360) <br />
  65. DrawImage gfxTemp,Rnd(640),Rnd(480) <br />
  66. Wend
  67. </td>
  68. </tr>
  69. </table>
  70. <br>
  71. <a target=_top href=../index.htm>Index</a><br>
  72. <br>
  73. Click <a href=http://www.blitzbasic.co.nz/b3ddocs/command.php?name=RotateImage&ref=comments target=_blank>here</a> to view the latest version of this page online</body>
  74. </html>