日期:2014-05-18  浏览次数:20407 次

很奇怪,生成图片的高难度问题,欢迎各位高手进来讨论!
将flash设计的作品生成图片(用XML导出所有信息),但是生成图片的时候,却出现了很奇怪的问题:
    1,如果文字是粗体,斜体,带下划线其中的一种,则正常!
    2,如果文字是粗体又是带下划线,也正常,粗体也是斜体也正常
    3,如果是斜体带下划线,或者粗体,斜体,下划线都是的话,则生成的图片是仅带下划线,或者粗体下划线,即:斜体的属性没有了
    4,同样的文件,生成PDF没有问题;
    生成图片程序如下:
private   void   buildWordI(XmlNode   wordNode,   Graphics   g)
        {
                /*
                  *   <font= "null "  
                  *   y= "511 "  
                  *   x= "515 "  
                  *   size= "12 "  
                  *   leading= "0 "
                  *   letterSpacing= "0 "
                  *   align= "left "  
                  *   italic= "false "
                  *   underline= "false "  
                  *   bold= "false "  
                  *   text= "在此输入内容 "   />
                */
                string   font   =   wordNode.Attributes[ "font "].Value.ToString();
                int   size   =   int.Parse(wordNode.Attributes[ "size "].Value);
                string   italic   =   wordNode.Attributes[ "italic "].Value.ToString();
                string   underline   =   wordNode.Attributes[ "underline "].Value.ToString();
                string   bold   =   wordNode.Attributes[ "bold "].Value.ToString();
                string   align   =   wordNode.Attributes[ "align "].Value.ToString();
                string   text   =   wordNode.Attributes[ "text "].Value.ToString();
                int   color   =   int.Parse(wordNode.Attributes[ "color "].Value);
                float   x   =   float.Parse(wordNode.Attributes[ "x "].Value);
                float   y   =   float.Parse(wordNode.Attributes[ "y "].Value);
                float   width   =   float.Parse(wordNode.Attributes[ "width "].Value)   +   200;
                float   height   =   float.Parse(wordNode.Attributes[ "height "].Value);
            &n