標籤:cWeb http color java os io for ar
Dynamic Web TWAINTWAIN掃描識別工具添加文本到映像Dynamic Web TWAIN 是應用於Web應用程式的TWAIN掃描識別工具,只需在TWAIN介面寫幾行代碼,就可以用相容TWAIN的掃描器掃描文檔或從數位相機/採集卡中擷取映像,並對採集下來的映像進行處理。版本支援
Dynamic Web TWAIN各版本v7及以上
文法
Boolean ObjectName.AddText(Short ImageIndex, Int x, Int y, String Text, Int TextColor, Int
BackgroundColor, float BackgroundRoundRadius, float BackgroundOpacity)
參數
- Short ImageIndex:靶心圖表像索引
- Int x:文本的X座標
- Int y:文本的Y座標
- String Text:要添加的文本
- Int TextColor:文本顏色
- Int BackgroundColor:背景色
- float BackgroundRoundRadius:範圍是0到0.5;註:Mac版不支援這個參數。
- float BackgroundOpacity:指定添加文本背景的不透明度,範圍是0到1.0;注意:Mac版支援0到1。
傳回值
Boolean:True表示成功,FALSE表示失敗
標記
IfThrowException屬性為True時,發生錯誤時會拋出一個異常。當返回FALSE或拋出異常時,檢查 ErrorCode 屬性和ErrorString屬性擷取錯誤資訊。
樣本
下面是一個JavaScript樣本:
<script language="javascript"type="text/javascript"> DWObject = document.getElementById("iDynamicWebTwain");//iDynamicWebTwain is the id of the Dynamic Web TWAIN on the page (An object or an embed). functionbtnAddText_onclick() { DWObject.AddText( DWObject.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>