yiyiwyy 发表于 2006-5-10 17:46:00

如何把VBA转化成C#

<P></P>
<P>诚恳的请求大家帮帮忙,怎么用C#实现在AutoCAD中插入光栅图像?我看到过VBA的代码如下:</P>
<P>&nbsp;Dim insertionPoint(0 To 2) As Double<BR>&nbsp;&nbsp;&nbsp; Dim scalefactor As Double<BR>&nbsp;&nbsp;&nbsp; Dim rotationAngle As Double<BR>&nbsp;&nbsp;&nbsp; Dim imageName As String<BR>&nbsp;&nbsp;&nbsp; Dim rasterObj As AcadRasterImage<BR>&nbsp;&nbsp;&nbsp; Dim pt_Pick As Variant<BR>&nbsp;&nbsp;&nbsp; imageName = "C:\CNSI_Demo\Pictures\" &amp; Current_ProductID &amp; ".jpg"<BR>&nbsp;&nbsp;&nbsp; insertionPoint(0) = 5#: insertionPoint(1) = 5#: insertionPoint(2) = 0#<BR>&nbsp;&nbsp;&nbsp; scalefactor = 300<BR>&nbsp;&nbsp;&nbsp; rotationAngle = 0<BR>&nbsp;&nbsp;&nbsp; <BR>&nbsp;&nbsp;&nbsp; pt_Pick = ThisDrawing.Utility.GetPoint(, "插入点:")<BR>&nbsp;&nbsp;&nbsp; Set rasterObj = ThisDrawing.ModelSpace.AddRaster(imageName, pt_Pick, scalefactor, rotationAngle)</P>
<P>可我要用C#实现它,有人可以帮帮我吗?谢谢了!</P>

gdkpzsk 发表于 2015-2-26 10:32:48

试试这个.好用的.
页: [1]
查看完整版本: 如何把VBA转化成C#