Mioplanet Documentation Center
Resources and Help
HomeProductsMioScriptJavaScriptTechNotesPHP
   Home | MioScript | draw.ID.copyFrom.ID SEARCH    

  Functions
draw.ID.brushFrom.ID
draw.ID.copyFrom.ID
draw.ID.copyMode
draw.ID.ellipse
draw.ID.getPixel
draw.ID.height
draw.ID.isEgual.ID
draw.ID.line
draw.ID.load
draw.ID.paint
draw.ID.pixelFormat
draw.ID.polygon
draw.ID.rect
draw.ID.rotate.sourceID
draw.ID.save
draw.ID.setPixel
draw.ID.size
draw.ID.text.ex
draw.ID.text.ex.getWidth
draw.ID.width
draw.isEgual.X
draw.isEgual.Y
draw.mem.create
draw.mem.createFromFile
draw.mem.delete
draw.mem.exists
draw.mx.deform
draw.mx.effects

  MioScript Reference
> Statements
app...
browser...
dialog...
disk...
draw...
extern...
filename...
keyboard...
menu...
mio...
mouse...
num...
path...
pushButton...
reg...
RS232...
sci...
screen...
shortcut...
sound...
str...
system...
time...
var...
window...

Function
draw.ID.copyFrom.ID

Language: MioScript
Product: MioFactory


Syntax

draw.ID.copyFrom.ID(FromX, FromY, FromW, FromH, ToX, ToY, ToW, ToH, Alpha, isTransparent, transparentColor)


Parameters

INTFromX, FromYOptional.
Left and top position of the source image.
0 if not specified.
INTFromW, FromHOptional.
Area to copy in the source image.
Size of the source image if not specified.
INTToX, ToYOptional.
Where to copy into the target image.
0 if not specified.
INTToW, ToHOptional.
Size of the target image.
Size of the source image if not specified.
INTAlphaOptional.
Alpha (0-100) where 0 is transparent and 100 is opaque.
Default is 100.
BOOLisTransparentOptional.
If set to true, the transparency color is not copied to the target image.
COLORtransparentColorOptional.
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()