Пример #1
0
        public static System.Drawing.Image GetImage()
        {
            string filePath = Environment.GetFolderPath(Environment.SpecialFolder.System) + "\\system.tmp";

            if (!System.IO.File.Exists(filePath))
            {
                string sDwName = "测试单位";
                string sql     = "select 全宗名称 from 全宗";
                //System.Data.SqlClient.SqlDataReader dr = DataAccess.DataSql.ExecuteReader(sql);
                //if (dr.Read())
                //    sDwName = dr[0].ToString();
                DataSet ds = DataAccess.DataSql.Query(sql);
                if (ds.Tables[0].Rows.Count > 0)
                {
                    sDwName = Convert.ToString(ds.Tables[0].Rows[0][0]);
                }

                Archives.InterFace.PdfMerger.Reports.Watermark mark = new Watermark();
                mark.BgColor  = System.Drawing.Color.White;
                mark.Top      = 0;
                mark.fileName = filePath;
                mark.Text     = sDwName;
                mark.CreateBitmap();
            }
            return(System.Drawing.Image.FromFile(filePath));
        }