ScaleImage.htm 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  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>ScaleImage image,xscale#,yscale#</h1>
  8. <h1>Parameters</h1>
  9. <table>
  10. <tr>
  11. <td>
  12. image = file handle variable to a previously loaded image <br />
  13. xscale# = the amount to scale the image horizontally <br />
  14. yscale# = the amount to scale the image vertically
  15. </td>
  16. </tr>
  17. </table>
  18. <h1>Description</h1>
  19. <table>
  20. <tr>
  21. <td>
  22. Use this command to rescale an image to a new size using a floating point percentage (1.0 = 100%, 2.0 = 200%, etc). Using a negative value perform image flipping. You must've previously loaded the image with LoadImage or LoadAnimImage. <br />
  23. <br />
  24. This is NOT intended for REAL TIME scaling of images! Precalculate your images before running your program, or you will likely see massively slow renderings of graphics.
  25. </td>
  26. </tr>
  27. </table>
  28. <h1><a href=../2d_examples/ScaleImage.bb>Example</a></h1>
  29. <table>
  30. <tr>
  31. <td>
  32. ; ScaleImage example <br />
  33. <br />
  34. ; Set Graphics Mode <br />
  35. Graphics 800,600,16 <br />
  36. <br />
  37. ; Randomize the random seed <br />
  38. SeedRnd MilliSecs() <br />
  39. <br />
  40. ; Load an image to tile (your location might vary) <br />
  41. gfxBall=LoadImage("C:Program FilesBlitz Basicsamplesall.bmp") <br />
  42. <br />
  43. ; Scale it randomly from 50% to 150% both x and y <br />
  44. ScaleImage gfxBall,Rnd(-2.0,2.0),Rnd(-2.0,2.0) <br />
  45. <br />
  46. ; Wait for ESC to hit <br />
  47. While Not KeyHit(1) <br />
  48. DrawImage gfxball,Rnd(800),Rnd(600) <br />
  49. VWait <br />
  50. Wend <br />
  51. </td>
  52. </tr>
  53. </table>
  54. <br>
  55. <a target=_top href=../index.htm>Index</a><br>
  56. <br>
  57. Click <a href=http://www.blitzbasic.co.nz/b3ddocs/command.php?name=ScaleImage&ref=comments target=_blank>here</a> to view the latest version of this page online</body>
  58. </html>