www.mxdraw.com
内容索引主面
前一个向上下一个
IMxDrawImageMark 接口

IMxDrawImageMark组件。 支持扩展属性"textOffsetPosition",类型为: McGePoint3d 支持扩展属性"Transparent",类型为: LONG,可以设置图片的透明度,取值在0~100

IDL
[ object, uuid(140035C2-9BC7-433F-A90D-DA409A2C91B4), dual, nonextensible, helpstring("IMxDrawImageMark interface"), pointer_default(unique) ]
interface IMxDrawImageMark : IMxDrawEntity;

MxDrawImageMark.idl

例如: VC COM

        LONGLONG lId = m_ocx.DrawImageMark(0,0,1.0,0.0,_T("G:\marker.png"),_T(""),TRUE);

        IDispatchPtr spDispatch(m_ocx.ObjectIdToObject(lId) ,false);
        IMxDrawImageMarkPtr spImage;
        spDispatch->QueryInterface(&spImage);
        if(spImage == NULL)
                return;

        IMxDrawResbufPtr param;
        param.CreateInstance(__uuidof( MxDrawXLib::MxDrawResbuf ));
        IMxDrawPointPtr pt;
        pt.CreateInstance(__uuidof( MxDrawXLib::MxDrawPoint ));
        pt->x = 0.0;
        pt->y = -70.0;

        param->AddPoint(pt);

        spImage->MxSetProp(_T("textOffsetPosition"),param);
        spImage->Text = _T("合格");

        IMxDrawResbufPtr spData = spImage->MxGetProp(_T("textOffsetPosition"));
        IMxDrawPointPtr spPt = spData->AtPoint(0);

        double dX,dY,dZ;
        spPt->get_x(&dX);
        spPt->get_x(&dY);
        spPt->get_x(&dZ);

例如: JS

        var sImageFile1 = "G:\downland\新建文件夹\新建文件夹\ie\marker.png";
        var lId = mxOcx.DrawImageMark("40030.696470", "10564.051271", 1, 0, sImageFile1, "", true);
        //mxOcx.TwinkeEnt(lId);
        // 给一个很大的数据,可以代表把它放到最上面去。
        mxOcx.SetEntityDrawOrder(lId,999999);
        var imageMark = mxOcx.ObjectIdToObject(lId);
    
        var textOffset = mxOcx.NewPoint();
        textOffset.x = 0.0;
        textOffset.y = -70;
    
        var param = mxOcx.NewResbuf();
        param.AddPoint(textOffset);
        imageMark.SetProp("textOffsetPosition",param);
    
        imageMark.Text = "合格";

例如: C#

            Int64 lId = axMxDrawX1.DrawImageMark(0, 0, -100, 15 * 3.14159265 / 180.0, "G:\1.jpg", "", true);
    
            MxDrawImageMark imageMark = (MxDrawImageMark)axMxDrawX1.ObjectIdToObject(lId);
            // 设置图片的透明度

            MxDrawResbuf param = new MxDrawResbuf();

            param.AddLong(50);

            imageMark.SetProp("setTransparent", param);
            axMxDrawX1.ZoomAll();
            axMxDrawX1.UpdateDisplay();
Copyright (c) 2010. All rights reserved.
你认为该帮助怎么样? 发送反馈信息!