阅读:1775回复:1
delphi+MO中InterSect函数的参数问题
delphi+MO中InterSect函数的参数问题:不知道怎么使用这个InterSect函数啊
在VB中是这样的,Ploy:=Poly1.InterSect(Poly2),那在Delphi中这段代码到底是怎样的呢?希望各位大虾回答啊,急。 |
|
1楼#
发布于:2006-08-01 15:54
<TABLE fixed; WORD-BREAK: break-all" height="85%" width="95%" align=center border=0>
<TR> <TD 9pt; LINE-HEIGHT: 12pt" vAlign=top width=* height="100%"><IMG src="http://www.lcgis.net/BBS/Skins/Default/topicface/face1.gif"> <B></B><BR> <P>两条线相交的情况,主要是Intesect方法的参数,和返回值难以设置,程序写的不是很好,<BR>var pInterSect:variant;<BR>………………<BR> pInterSect:=templine.Intersect(shape,shape.Extent);<BR>//没有交点 <BR>if IDispatch(pIntersect)=nil then<BR> begin<BR> exit;<BR> end;<BR>//一个交点<BR>if (pInterSect.shapetype)=moShapeTypePoint then<BR> begin<BR> Pnt:=IMOpoint(Createoleobject('Mapobjects2.Point'));<BR> pnt:=IMOPoint(IDispatch(pInterSect));<BR> end<BR>//多个交点<BR> else if (pInterSect.shapetype)=moShapeTypeMultipoint then<BR> begin<BR> Pnts:=IMOPoints(CreateOleObject('MapObjects2.Points'));<BR> Pnts:=IMOPoints(Idispatch(pInterSect));<BR> end;<BR>//相交的结果是一条线<BR>……</P></TD></TR></TABLE> |
|