60 lines
1.7 KiB
HTML
60 lines
1.7 KiB
HTML
<html>
|
|
<head>
|
|
<title>Blitz3D Docs</title>
|
|
<link rel=stylesheet href=../css/commands.css type=text/css>
|
|
</head>
|
|
<body>
|
|
<h1>ScaleImage image,xscale#,yscale#</h1>
|
|
<h1>Parameters</h1>
|
|
<table>
|
|
<tr>
|
|
<td>
|
|
image = file handle variable to a previously loaded image
|
|
<br />
|
|
xscale# = the amount to scale the image horizontally
|
|
<br />
|
|
yscale# = the amount to scale the image vertically
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<h1>Description</h1>
|
|
<table>
|
|
<tr>
|
|
<td>
|
|
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 />
|
|
|
|
<br />
|
|
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.
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<h1><a href=../2d_examples/ScaleImage.bb>Example</a></h1>
|
|
<table>
|
|
<tr>
|
|
<td>
|
|
; ScaleImage example
|
|
<br />
|
|
|
|
<br />
|
|
; Set Graphics Mode
|
|
<br />
|
|
Graphics 800,600,16
|
|
<br />
|
|
|
|
<br />
|
|
; Randomize the random seed
|
|
<br />
|
|
SeedRnd MilliSecs()
|
|
<br />
|
|
|
|
<br />
|
|
; Load an image to tile (your location might vary)
|
|
<br />
|
|
gfxBall=LoadImage("C:Program FilesBlitz Basicsamplesall.bmp")
|
|
<br />
|
|
|
|
<br />
|
|
; Scale it randomly from 50% to 150% both x and y
|
|
<br />
|
|
ScaleImage gfxBall,Rnd(-2.0,2.0),Rnd(-2.0,2.0)
|
|
<br />
|
|
|
|
<br />
|
|
; Wait for ESC to hit
|
|
<br />
|
|
While Not KeyHit(1)
|
|
<br />
|
|
DrawImage gfxball,Rnd(800),Rnd(600)
|
|
<br />
|
|
VWait
|
|
<br />
|
|
Wend
|
|
<br />
|
|
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<br>
|
|
<a target=_top href=../index.htm>Index</a><br>
|
|
<br>
|
|
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>
|
|
</html>
|