我有一個cv :: Point2f向量。我想要的是將這個向量從C++/CLI傳遞給C#。將STL/C++/CLI容器傳遞給.Net
由於我不能將cv :: Point2f存儲到std :: vector中,所以我使用了cliext :: vector。 然後,我不知道如何從C#得到它...
這是C++/CLI我的代碼:
點是誰已經被定義CV :: Point2f的載體在其他地方初始化。
在C++/CLI,
cliext::vector<System::Drawing::Point> ManagedCPP::Points::get() {
cliext::vector<System::Drawing::Point> cliext_points;
for (auto &point : points) {
cliext_points.push_back(System::Drawing::Point(points.x, points.y));
}
return corners;
}
在C#,
ManagedCPP mcpp = new ManagedCPP();
??? = mcpp.get_Points(); // what should be ???
或是否有任何的類型轉換需要的?
http://stackoverflow.com/questions/21673874/c-cli-cliextvectort-as-return-type-of-public-class-function – SHR
不,標題是好的,我已經睡:) 。對不起,我不介意:) – ipavlu
請不要使用C++標記C++/CLI,謝謝(cc @Atomic) – Deduplicator