# Command Source_NewImage

## Using of command

This command is use for creation new image. There are 2 options for creation image in this command.The first is clone image.Image is clone from existing command. New image is same as clone image.Next option is create new image. You can select all parameters. Parameters can be defined by number or from variable or from existing image.

## Commands parameters

Function has 9 parameters:

1. Type of command: This parameter is use for select option for creation of new image.Option "Create image" is use for creation new image according sets parameters.Option "Clone image" create new image as a clone of existing image.
2. Destination picture: This parameter sets destination picture which will be result of this command and new image will be save in this picture. You can select Picture_0 to Picture_19.
3. Clone Source picture: This parameter is use only in Clone image option.Existing image which can be use for clone is selected.New image will be same as image selected in this parameter.You can not select same image as in parameter Destination image.Image selected in this parameter must be already alocated in previous commands.
4. Width from: This option is use for select from where width of new picture will be set.Parameter is use only in option "Create image". You can select Picture_0 to Picture_19, in this case with of new image will be same as in selected picture. Next you can select Variable_0 to Variable_99, in this case width of new picture will be sets in selected variable.Last option is Fixted_number, in this case width of new picture is select in next parameter as a number. In all cases dimension is sets in pixels.
5. Fixted number Width: This option is use only in option "Create image" and if option "Fixted number" in previous command is selected. In other cases this parameter is not use. You need write width of new picture in pixels.
6. Height from:This option is use for select from where height of new picture will be set.Parameter is use only in option "Create image". You can select Picture_0 to Picture_19, in this case height of new image will be same as in selected picture. Next you can select Variable_0 to Variable_99, in this case height of new picture will be sets in selected variable.Last option is Fixted_number, in this case height of new picture is select in next parameter as a number. In all cases dimension is sets in pixels.
7. Fixted number Height:his option is use only in option "Create image" and if option "Fixted number" in previous command is selected. In other cases this parameter is not use. You need write height of new picture in pixels.
8. Depth of image: This parameter is use only in option "Create image".This option select bit depth of image elements.
   It can be select:
   IPL_DEPTH_8U - unsigned 8-bit integers
   IPL_DEPTH_8S - signed 8-bit integers
   IPL_DEPTH_16U - unsigned 16-bit integers
   IPL_DEPTH_16S - signed 16-bit integers
   IPL_DEPTH_32S - signed 32-bit integers
   IPL_DEPTH_32F - single precision floating-point numbers
   IPL_DEPTH_64F - double precision floating-point numbers
9. Number of channels:THis option is valid only in option "Create image".This parameter select number of channels per pixel. You can select 1,2,3 or 4.
10. New image colour: This parameter is use only if option new image in the first parameter is selected. Click on this line display colour selection dialog. You can select colour of new image background. All pixels in new image will be fill in this colour code.

## Error codes

1. Error code -11: Bad destination picture. THis error means that destination picture is not in range Picture_0 to Picture_19. Check test program if option destination picture is sets correctly.
2. Error code -12: Bad source image.Error means that source picture for clone image is not in range Picture_0 to Picture_19. Check test program if option source picture for clone image is sets correctlly.
3. Error code -13: Source image is not alocated. Error means that source image was not alocated in previous commands. Source image for for clone must be alocated in in previous command.
4. Error code -14: Source and destination image is same. Source and destination image can not be same.
5. Error code -15: Bad picture position. Parameter for picture from where width or height is set is not in range Picture_0 to Picture_19.Check test program if this parameter is sets correctlly.
6. Error code -16:Bad variable position. Parameter for variable from where width or height is set is not in range Variable_0 to Variable_99.Check test program if this parameter is sets correctly.
7. Error code -17:Width is less or equal 0. Width number must be positive and more than 0. Check if variable or fixted number for select width is more than 0.
8. Error code -18: Height is less or equal 0. Height number must be positive and more than 0.
9. Error code -19:Bad channels number: Channel nuber is not in range 1 to 4.Check test program if this parameter is sets correctlly.
10. Error code -20:Bad colour code: Some of colour number is less than 0 or more than 255. All 3 colour codes must be in range 0-255.
11. Error code -100: Open Cv error: This error is generated in Open Cv function and explanation of this error will be display in result window.