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

控件中的文字样式表

IDL
[ object, uuid(668555CA-2F80-41ED-B51C-E1524F1EA62C), dual, nonextensible, helpstring("IMxDrawTextStyleTable interface"), pointer_default(unique) ]
interface IMxDrawTextStyleTable : IMxDrawSymbolTable;

MxDrawTextStyleTable.idl

例如: C# 增加一个文字样式,并设置当前文字样式等于新增加的样式.

            MxDrawApplication mxapp = new MxDrawApplication();
            MxDrawDatabase mxdb = mxapp.WorkingDatabase();
            MxDrawTextStyleTable mxtst = mxdb.GetTextStyleTable();
            MxDrawTextStyleTableRecord mxtstr = mxtst.Add("duanceng");
            mxtstr.SetFont("黑体", false, false, 0, 0);
            mxtstr.textSize = 5;
            mxapp.WorkingDatabase().CurrentlyTextStyle = "duanceng";
            //axMxDrawX1.AddTextStyle2("duanceng", "黑体", 1.0);

 

例如: C# 取对象的文字样式数据

        MxDrawUtility mxUtility = new MxDrawUtility();
        MxDrawPoint getPt;
        MxDrawEntity ent = mxUtility.GetEntity(out getPt, "选择实体");
        if(ent == null)
            return;
        MxDrawDatabase database = (MxDrawDatabase)axMxDrawX1.GetDatabase();
        MxDrawTextStyleTableRecord textStyle = database.GetTextStyleTable().GetAt(ent.TextStyle);                
        if(textStyle != null)
        {
            string pTypeface;
            bool bold = false;
            bool italic = false;
            int charset = 0;
            int pitchAndFamily = 0;

            textStyle.Font(out pTypeface, out bold, out italic, out charset, out pitchAndFamily);
        }
Copyright (c) 2010. All rights reserved.
你认为该帮助怎么样? 发送反馈信息!