读书人

帮忙把下面一段VC代码转化为VB.net?多

发布时间: 2011-12-31 23:50:30 作者: rapoo

帮忙把下面一段VC代码转化为VB.net?谢谢了!
1.在SceneControl的ISceneGraphEvents.AfterDraw事件中处理以下过程
..............
/************获取三维场景目标点****************/
ICameraPtr ipCamera;
ipSceneControl->get_Camera(&ipCamera);
IPointPtr ipTarget;
ipCamera->get_target(&ipTarget);
/****根据坐标点位置,在相应的MapControl中绘制点符号******/
IMarkerElementPtr ipMarkerElement(CLSID_MarkerElement);
IElementPtr ipElement(ipMarkerElement);
ipElement->put_Geometry(ipTarget);

IRgbColorPtr rgbColor_ip(CLSID_RgbColor);
rgbColor_ip->put_Red(255);
rgbColor_ip->put_Green(0);
rgbColor_ip->put_Blue(0);
IMarkerSymbolPtr ipMarkerSymbol(CLSID_SimpleMarkerSymbol);
ipMarkerSymbol->put_Color(rgbColor_ip);
ipMarkerSymbol->put_Size(6);
ipMarkerElement->put_Symbol(ipMarkerSymbol);

IActiveViewPtr ipMapActiveView;
ipMapControl->get_ActiveView(&ipMapActiveView);
IGraphicsContainerPtr ipGraphicsContainer(ipMapActiveView);
ipGraphicsContainer->DeleteAllElements();

ipGraphicsContainer->AddElement((IElementPtr) ipMarkerElement,0);

ipMapActiveView->Refresh();
2.在MapControl的MouseDown事件中处理以下过程

ICameraPtr camera_ip;
ipSceneControl->get_Camera(&camera_ip);
IPointPtr target_ip;
camera_ip->get_Target(&target_ip);
target_ip->put_X(mapX);
target_ip->put_Y(mapY);
camera_ip->put_Target(target_ip);

ISceneGraphPtr ipSceneGraph;
ipSceneControl->get_SceneGraph(&ipSceneGraph);
ipSceneGraph->RefreshViewers();
本人对VC实在看不懂,哪位高手帮忙忙,把上面的代码转化为VB.net?谢谢了!

[解决办法]
调用的类库不一样.即使能转.换成vb.net有参考价值么
[解决办法]
你这代码就两种语句,一种定义变量,一种调用方法,看不懂?
定义变量的改成
ICameraPtr camera_ip;
--->
dim camera_ip as ICameraPtr

调用方法的改成
ipSceneGraph->RefreshViewers();
--->
ipSceneGraph.RefreshViewers()

读书人网 >VB Dotnet

热点推荐