TWAIN ActiveX/Plug-in Windows/Mac HTTP Control/SDK

OverlayRectangle Method

Description

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

Support information

ActiveX Edition Plug-in Edition Mac Edition
Since V5.0 Since V5.0 Not Supported

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 © 2012 Dynamsoft Corporation. All Rights Reserved.