¿Cómo Web TWAIN-- dinámico resaltar el área seleccionada en la imagen

A veces se puede desear ciertas partes de la imagen de relieve. Dynamic Web TWAIN proporcionar OverlayRectangle esta manera para admitir esta función.

En primer lugar, es necesario seleccionar el área que desea resaltar:

// 使用 OnImageAreaSelected 事件来选择想突出显示的区域
function Dynamsoft_OnImageAreaSelected(index, left, top, right, bottom) { 
  _iLeft = left;
  _iTop = top;
  _iRight = right;
  _iBottom = bottom; } 

// 使用 OnImageAreaDeselected 事件取消选择
function Dynamsoft_OnImageAreaDeselected(index) { 
  _iLeft = 0;
  _iTop = 0; 
  _iRight = 0; 
  _iBottom = 0; }

Resaltar el área (en el que se añade un rectángulo gris)

DWObject.OverlayRectangle(
    DWObject.CurrentImageIndexInBuffer,
    _iLeft, _iTop, _iRight, _iBottom, 0x000000/*指定颜色*/, 0.5/*不透明度*/
);

color designado: Se especifica en el valor RGB de 24 bits. El valor predeterminado es blanco (0xffffff). Byte orden de valor RGB de 24 bits es BBGGRR. BB representa azul, verde representa GG, RR representa rojo.

Opacidad: Especificar la opacidad del rectángulo. 1.0 representa el 100% de opacidad, 0,0 es completamente transparente.

 

 

Liberadas dos artículos originales · ganado elogios 4 · Vistas 4053

Supongo que te gusta

Origin blog.csdn.net/weixin_42320186/article/details/88912912
Recomendado
Clasificación