Dynamic Web TWAIN  - TWAIN ActiveX/Plug-in, Scanner COM Control
TWAIN ActiveX/Plug-in HTTP Control/SDK

OverlayRectangle Method

Description

Decorates image of a specified index in buffer with rectangles of transparent color.

Syntax

Boolean ObjectName.OverlayRectangle(short sImageIndex, Int32 iLeft, Int32 iTop, Int32 iRight, Int32 iBottom, Int32 ColorRGB, Single Opacity)

Parameters

short sImageIndex: Specifies the index of image in buffer. The index is 0-based.

Int32 iLeft: Specifies the x-coordinate of the upper-left corner of the rectangle.

Int32 iTop: Specifies the y-coordinate of the upper-left corner of the rectangle.

Int32 iRight: Specifies the x-coordinate of the lower-right corner of the rectangle.

Int32 iBottom: Specifies the y-coordinate of the lower-right corner of the rectangle.

Int32 ColorRGB: Specifies the fill color of the rectangle. The byte-ordering of the RGB value is 0xBBGGRR. GG represents green, BB represents blue, RR represents red.

Single Opacity: Specifies the opacity of the rectangle. The value represents opacity. 1.0 is 100% opaque and 0.0 is totally transparent.

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.

See also

MouseX MouseY

Sample

Javascript Sample:

    function DynamicWebTWAIN_OnMouseClick()
    {
    	var Xcoordinate = Twain.MouseX;
    	var Ycoordinate = Twain.MouseY;
	Twain.OverlayRectangle(Twain.CurrentImageIndexInBuffer,Xcoordinate-300,Ycoordinate-10,Xcoordinate+300,Ycoordinate+10,0xff0000,0.5);  	
    }

VB Sample:

    Private Sub WebTwain_OnMouseClickEvent(ByVal sender As System.Object, ByVal e As AxDYNAMICWEBTWAINCTRLLib._IDynamicWebTwainEvents_OnMouseClickEvent)
	Dim Xcoordinate as long
        Dim Ycoordinate as long
        Xcoordinate = Twain.MouseX;
	Ycoordinate = Twain.MouseY;
	Twain.OverlayRectangle(Twain.CurrentImageIndexInBuffer,Xcoordinate-300,Ycoordinate-10,Xcoordinate+300,Ycoordinate+10,0xff0000,0.5)
    End Sub
 

 

 

 













TWAIN ActiveX | TWAIN Plug-in | TWAIN Control | TWAIN SDK | Scanner COM
Software Configuration Management | Version Control | Source Control
Copyright © 2011 Dynamsoft Corporation. All Rights Reserved.