Halcon绘制矩形

    Herror error_num;
    HTuple Rect_ID;

    try {
        //绘制矩形
        //HalconCpp::GenRectangle1(&m_rectAngle, ltoprow, ltopcol, rbottomrow, rbottomcol);
        //HalconCpp::DispObj(m_rectAngle, m_hHalconID);
        //HalconCpp::DispRegion(m_rectAngle, m_hHalconID);

        //绘制矩形
        CreateDrawingObjectRectangle1(ltoprow, ltopcol, rbottomrow, rbottomcol,&Rect_ID);
        SetDrawingObjectParams(Rect_ID,"color","red");
        qDebug()<<"Rect_ID"<<Rect_ID.D()<<endl;
        m_Drawing_Index.append(Rect_ID);
        //转换句柄为HDrawingObject
        HDrawingObject draw=HDrawingObject(Rect_ID);
        AttachDrawingObjectToWindow(m_hHalconID,Rect_ID);
        AttachDrawObj(draw);

    }
    catch (HException &except)
    {
        error_num = except.ErrorNumber();
        qDebug() << QString::number(error_num);
        return;
    }

你可能感兴趣的:(Halcon,QT)