zoukankan      html  css  js  c++  java
  • FastReport编程方式给Picture控件赋值

        public Image BytesToImage(Byte[] buffer)
        {
          var ms = new MemoryStream(buffer, 0, buffer.Length);
            
          return Image.FromStream(ms);
        }
        private void Text26_BeforePrint(object sender, EventArgs e)
        {                 
          DataSourceBase ds = Report.GetDataSource("subDataTable");
    
          ds.Init();      
          while (ds.HasMoreRows)
          {
            // get the data column value from the current row
            string imgName = (string)Report.GetColumnValue("subDataTable.IMGNAME");
                          
            if(imgName=="img2")
            {          
               Picture2.Image=  BytesToImage(Convert.FromBase64String(Report.GetColumnValue("subDataTable.检测图片").ToString())) ;
            }  
            // do something with it...
            s+=imgName+",";  
            // go next data row
            ds.Next();
          }                
        }
    
  • 相关阅读:
    第九周周记
    第七周周记
    第三次作业第一题
    第五周周记
    《世界是数字的》读后感想
    第十周周记
    迷茫
    测试作业
    价值观作业
    作业二 感想
  • 原文地址:https://www.cnblogs.com/LittleFeiHu/p/10119655.html
Copyright © 2011-2022 走看看