首页 > 代码库 > vc和halcon数据的相互赋值

vc和halcon数据的相互赋值

// HTuple→VC 数据类型转换HTuple hTuple = 1234;int i = hTuple[0].I();                  // i=1234long l = hTuple[0].L();                 // l=1234long lNumber = hTuple.Num();            // lNumber=1,数据个数double d = hTuple[0].D();               // d=1234.0000    hTuple = "1234";CString strBuffer = hTuple[0].S();      // strBuffer="1234"        // VC→HTuple 数据类型转换int ii = 1234;double dd = 1234.1234;CString strTemp = "Halcon";    HTuple hTuple2;hTuple2[0] = ii;                        // hTuple2[0].I()=1234hTuple2[1] = dd;                        // hTuple2[1].D()=1234.1234hTuple2[2] = strTemp.GetBuffer();       // hTuple2[2].S()="Halcon"    i = hTuple2[0].I();                     // i=1234d = hTuple2[1].D();                     // d=1234.1234strBuffer = hTuple2[2].S();             // strBuffer="Halcon"lNumber = hTuple2.Num();                // lNumber=3,数据个数

  另外: 
Halcon 的路径类似为“D:/Addr/a.jpg”,即以“/”为分隔符。 
和 VC 所用的“\”不同,需要转换。