|
我用如下方法可以使figure窗口关掉,缺点是figure窗口还是会闪一下
- Public Class Form1
- Private Sub cmdDraw_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdDraw.Click
- Dim objMATLAB As Object
- objMATLAB = CreateObject("matlab.application")
- Dim strEnter As String
- Dim strCommand As String
- strEnter = Chr(13) & Chr(10)
- strCommand = "[x,y,z]=peaks(30);"
- strCommand = strCommand & strEnter
- strCommand = strCommand & "surfc(x,y,z);"
- strCommand = strCommand & strEnter
- strCommand = strCommand & "shading interp;"
- strCommand = strCommand & strEnter
- strCommand = strCommand & "saveas(gcf,'c:\temp.bmp');"
- strCommand = strCommand & strEnter
- strCommand = strCommand & "close(1)"
- objMATLAB.execute(strCommand)
- imgDraw.Image = Image.FromFile("C:\temp.bmp")
- imgDraw.Refresh()
- objMATLAB = Nothing
- End Sub
- End Class
复制代码 |
评分
-
1
查看全部评分
-
|