embed
Top  Previous  Next

embed ( integer Input, integer Output, integer Left, integer Top, integer Blend )

Use this function to insert an image or selection into another image. If both images are of different types, the input image will be automatically converted to match the type of the output image.

Parameters
 
Input  
 
An integer between 0 and 116 specifying the input image frame number. A value of 0 represents the DMA memory buffer of the video device. Values in the range of 100-116 correspond to hidden frames.  
 
Output  
An integer between 1 and 116 specifying the output image frame number. Values in the range of 100-116 correspond to hidden frames.  
 
Left, Top  
 
Integers specifying the coordinates of the point in the output image, into which the top left corner of the input image or selection will be inserted. The values are given in pixels.  
 
Blend  
 
An integer between 1 and 100 specifying the blending factor for the image inserted. Blending indicates how the pixels of the input image merge with underlying pixels in the output image. Decreasing this value will make the pixel in the output image dominate over the pixels in the inserted image. Increasing the blending level will make the pixels in the inserted image more dominant.  

Error flags

ERR_OK  
 
The flag set if successful.  
 
ERR_FAILED  
 
The flag set if failed.  

Example
 
This set of statements overlays a portion of the live video over a sample image by extracting a rectangular area from a captured image and inserting it into the sample image with a 50% of blending.  
 
setCurDir("samples")  
loadIm (101,"sample14.iwd")  
toGray (101, 101)  
do  
  grabim (0)  
  extract (0, 100, 0, 0, 300, 300)  
  duplicate (101,102)  
  embed (100, 102, 100, 100, 50)  
  duplicate (102,1)  
loop