Syntax
| draw.ID.copyFrom.ID(FromX, FromY, FromW, FromH, ToX, ToY, ToW, ToH, Alpha, isTransparent, transparentColor) |
Parameters
| INT | FromX, FromY | Optional. Left and top position of the source image. 0 if not specified.
| | INT | FromW, FromH | Optional. Area to copy in the source image. Size of the source image if not specified.
| | INT | ToX, ToY | Optional. Where to copy into the target image. 0 if not specified.
| | INT | ToW, ToH | Optional. Size of the target image. Size of the source image if not specified.
| | INT | Alpha | Optional. Alpha (0-100) where 0 is transparent and 100 is opaque. Default is 100.
| | BOOL | isTransparent | Optional. If set to true, the transparency color is not copied to the target image.
| | COLOR | transparentColor | Optional. Color to ignore when copying (isTransparent must be set to true) |
Return value
No value is returned.
Description
Copy a part of a bitmap into another bitmap.
This function make it possible to:
- Copy all or a part of an image;
- Resize the image, if the target size is not the same than the source size;
- Fade an image on another one, using the alpha level;
- Copy an image with a transparent color to create sprite like effects.
More effects and deformation can be defined with the functions draw.mx.effects and draw.mx.deform before the call of this function.
|
MioScript Sample Code
&myImage = loadImage("myImage.jpg")
draw.main.copyFrom.&myImage(
0,0,null,null,
0,0,null,null,
50,
false
)
draw.main.paint() |
|