在engine的工具(itool)裡:
onclick事件處理函式中:
ifeaturelayer targetlayer
然後宣告乙個imovepointfeedback作為滑鼠移動時捕捉點的顯示:
[c-sharp]view plain
copy
imovepointfeedback m_pmoveptfeed =
newmovepointfeedback();
mfeedback = (idisplayfeedback)m_pmoveptfeed;
i******markersymbol ******markersymbol = new
******markersymbolclass();
irgbcolor prgbcolor = new
rgbcolorclass();
prgbcolor.red = 0;
prgbcolor.green = 0;
prgbcolor.blue = 0;
******markersymbol.color = prgbcolor;
******markersymbol.size = 3;
******markersymbol.style = esri.arcgis.display.esri******markerstyle.esrismssquare;
isymbol symbol = ******markersymbol as
isymbol;
symbol.rop2 = esrirasteropcode.esriropnotxorpen;
= esrirasteropcode.;
m_pmoveptfeed.symbol = (isymbol)******markersymbol;
然後開始feedback的顯示(tmppoint是指開始的點,其實影響不大,如果不想要源點在螢幕上的話,可以取乙個在螢幕外的點):
[c-sharp]view plain
copy
m_pmoveptfeed.display = mmapcontrol.activeview.screendisplay;
m_pmoveptfeed.start(tmppoint, tmppoint);
在onmousemove事件中:
[c-sharp]view plain
copy
ipoint ppoint2 =
null
; if
(ppoint2 ==
null
) ppoint2 = ppoint;
((imovepointfeedback)mfeedback).moveto(ppoint2);
[c-sharp]view plain
copy
public
double
x, double
y, ifeaturelayer ifeaturelyr, imapcontrol3 axmapcontrol1,
double
return
ihitpoint;
} public
double
convertpixelstomapunits(iactiveview pactiveview,
double
pixelunits)
此時即可實現滑鼠實時地捕捉目標圖層上的物件,若需要獲取當前位置的捕捉點時,則可以在相應事件(例如onmousedown或ondbclick)中呼叫:
[c-sharp]view plain
copy
ipoint ppoint = ((imovepointfeedback)mfeedback).stop();
這時實時捕捉將會停止,若需要重新開始捕捉,則在之後呼叫這些語句即可:
[c-sharp]view plain
copy
//重新開始snap
ipoint tmppoint = new
pointclass();
tmppoint.putcoords(pmap.extent.xmin - 1, pmap.extent.ymin - 1);
imovepointfeedback m_pmoveptfeed = (imovepointfeedback)mfeedback;
m_pmoveptfeed.display = pmap.activeview.screendisplay;
m_pmoveptfeed.start(tmppoint, tmppoint);
原文連線:
engine的工具中實現Snapping 捕捉
在engine的工具 itool 裡 onclick事件處理函式中 ifeaturelayer targetlayer 然後宣告乙個imovepointfeedback作為滑鼠移動時捕捉點的顯示 然後開始feedback的顯示 tmppoint是指開始的點,其實影響不大,如果不想要源點在螢幕上的話,...
engine的工具中實現Snapping 捕捉
在engine的工具 itool 裡 onclick事件處理函式中 ifeaturelayer targetlayer 然後宣告乙個imovepointfeedback作為滑鼠移動時捕捉點的顯示 imovepointfeedback m pmoveptfeed new movepointfeedba...
SNA架構的幾種實現方式
參考資料 shared nothing architecture與php的童話 shared nothing architecture 以往集群架構都採用session共享模式進行設計,而後php等方面提出了sna架構,主張session不共享。sna架構思想,無論對企業應用還是大型互聯 極大提高了...