滑鼠移動區域區域性放大

2021-07-04 21:32:24 字數 1079 閱讀 7802

這個程式類似於**購物時,在商品影象上移動滑鼠,會出現乙個放大滑鼠周圍矩形區域內的區域性影象的視窗。話不多說,直接貼**。

[c-sharp]view plain

copy

#include 

#include 

#include 

#pragma comment( lib, "cv.lib" )

#pragma comment( lib, "cxcore.lib" )

#pragma comment( lib, "highgui.lib" )

iplimage* org = 0;  

iplimage* img = 0;   

iplimage* dst = 0;   

intfoo=60;  

void

on_mouse( 

intevent

, int

x, int

y, int

flags, 

void

* ustc)  

else

if(y>img->height-foo)  

else

}  else

if(x>img->width-foo)  

else

if(y>img->height-foo)  

else

}  else

else

if(y>img->height-foo)  

else

}  cvrectangle(img,p0,p1,cv_rgb(0,255,0));  

cvsetimageroi(org,cvrect(p0.x,p0.y,p1.x-p0.x,p1.y-p0.y));  

cvresize(org,dst);  

cvresetimageroi(org);  

cvshowimage( "img"

, img );  

cvshowimage("dst"

,dst);  

}  }  

intmain()    

效果圖如下

VB MapX移動滑鼠放大和縮小

private sub map1 mousemove button as integer,shift as integer,x as single,y as single dim x1 as double dim y1 as double dim x2 as double dim y2 as dou...

第44天 滑鼠移動放大效果

1 滑鼠移動放大效果 1 doctype html 2 html lang en 3 head 4 meta charset utf 8 5 title 滑鼠移動放大效果 大盒子裡的 68small.onmouseover function 72 small.onmouseout function ...

element ui區域性區域loading效果

有時候我們不想為整個頁面新增loading效果。只想給區域性區域新增loading效果。我們可以使用下面這種方法 在某乙個擁有el標籤的區域用v loading標籤,這裡我就是加了乙個el main標籤,然後在這個標籤裡繫結v loading達到loading效果。element loading t...