AddText Method
Description
Add text on an image.
| ActiveX Edition | Plug-in Edition | Mac Edition |
|---|---|---|
| Since V7.0 | Since V7.0 | Since V7.0 |
Syntax
Boolean ObjectName.AddText(Short ImageIndex, Int x, Int y, String Text, Int TextColor, Int BackgroundColor, float BackgroundRoundRadius, float BackgroundOpacity)
Parameters
Short ImageIndex: the index of the image that you want to add text to.
Int x: the x coordinate for the text.
Int y: the y coordinate for the text.
String Text: the content of the text that you want to add.
Int TextColor: the color for the text.
Int BackgroundColor: the background color.
float BackgroundRoundRadius: ranging from 0 to 0.5.
float BackgroundOpacity: specifies the opacity of the background of the added text, it ranges from 0 to 1.0.
Return value
Boolean.
TRUE indicates success. FALSE indicates failure.
Remarks
When an error occurs and IfThrowException property is TRUE, an exception will be thrown.
When FALSE is returned or an exception is thrown, check ErrorCode property and ErrorString property for error information.
Sample
A JavaScript sample is provided.
<script language="javascript" type="text/javascript">
Webcam = document.getElementById("iDynamicWebcam");//iDynamicWebcam is the id of the Dynamic Webcam on the page (An object or an embed).
function btnAddText_onclick() {
Webcam.AddText(
Webcam.CurrentImageIndexInBuffer,
document.getElementById("addText_Left").value,//Value for setting the x coordinate for the text
document.getElementById("addText_Top").value,//Value for setting the y coordinate for the text
document.getElementById("addText_Text").value,//The text to be added
document.getElementById("addText_TxtColor").value,//The color of the text
document.getElementById("addText_BgColor").value,//The background color of the text
document.getElementById("addText_BGRoundRadius").value,//The value for the background radius
document.getElementById("addText_BGOpacity").value//The value for the background opacity
);
}
</script>
