Matlab graphs directly inside C ++ GUI

I use the matlab compiler to create a shared C ++ library from my m files. Is it possible to display matlab graphics directly inside the C ++ GUI (not in a separate window)?

+3
source share
2 answers

I found an easy solution. If you use windows, you can simply install the Matlab window. something like that.

HWND h = FindWindow(L"SunAwtFrame", L"Figure 1"); void MatlabViewerHack::EmbedMatlabPlot(HWND h) { SetWindowPos(h,NULL,rect.left(), rect.top(), rect.width(), rect.height(),0); SetWindowLong(h, GWL_STYLE,WS_CHILD|WS_VISIBLE); SetParent(h, parent_widget); //dynamic_cast<QWidget*>(parent())->winId() //updating ui_state, windows xp, window 7 SendMessage(h, WM_UPDATEUISTATE, UIS_INITIALIZE, 0); SendMessage(parent_widget, WM_UPDATEUISTATE, UIS_INITIALIZE, 0); SendMessage(h, WM_CHANGEUISTATE, UIS_INITIALIZE, 0); SendMessage(parent_widget, WM_CHANGEUISTATE, UIS_INITIALIZE, 0); current_window = h; } 
+4
source

MATLAB uses JIDE , which is built on Java / Swing for its user interface. Embeddable numbers were not available for MATLAB Builder JA . Therefore, I think that, according to stijn, there are no embedded plots. I would like to be acquitted.

+1
source

Source: https://habr.com/ru/post/971922/


All Articles