- Getting Started
- Tutorials
- Command Reference
- 2D Graphics
- 3D Graphics
- Arithmetic
- Binary
- File Handling
- Input
- Screen Display
- Sound and Music
- Text Handling
- Time and Date
- Keywords
- Operators
- Arithmetic
- Bitwise
- Comparison
copyImage()
Purpose
Create a copy of an image
Description
Creates a copy of an image with adjustable source region
Syntax
handle = copyImage( imageHandle, source )
Arguments
handle Variable which will store the new image
imageHandle Handle of the image to copy
source Vector describing the desired region to copy
Example
// load image to copy
img = loadImage("Ansimuz/CyberpunkStreetLayer0")
// create copy with region x = 50, y = 50, width = 100, height = 100
img_copy = copyImage( img, { 50, 50, 100, 100 } )
// draw original image at top left of screen with a scale of 2
drawImage( img, 0, 0, 2 )
// draw copied image region at centre of screen with a scale of 3
drawImage( img_copy, gwidth() / 2, 0, 3 )
update()
sleep( 3 )
Associated Commands
clear(), createImage(), drawImage(), drawImageEx(), drawQuad(), drawSheet(), loadImage(), update(), uploadImage()