Example #1
0
        private void ShowPic(string WeightNo)
        {
            if (WeightNo.Length <= 0)
               return;

               BaseInfo getImage = new BaseInfo();

               getImage.QueryPDImage(WeightNo);
               DataTable dtTP = getImage.dtImage;
               if (dtTP.Rows.Count > 0)
               {
               byte[] imagebytes1 = (byte[])dtTP.Rows[0]["FB_IMAGE1"];
               byte[] imagebytes2 = (byte[])dtTP.Rows[0]["FB_IMAGE2"];
               byte[] imagebytes3 = (byte[])dtTP.Rows[0]["FB_IMAGE3"];
               byte[] imagebytes4 = (byte[])dtTP.Rows[0]["FB_IMAGE4"];
               if (imagebytes3.Length > 1 && imagebytes4.Length >1)
               {
                   getImage.BitmapToImage(imagebytes1, pictureBox1, pictureBox1.Width, pictureBox1.Height);
                   getImage.BitmapToImage(imagebytes2, pictureBox2, pictureBox2.Width, pictureBox2.Height);
                   getImage.BitmapToImage(imagebytes3, pictureBox3, pictureBox3.Width, pictureBox3.Height);
                   getImage.BitmapToImage(imagebytes4, pictureBox4, pictureBox4.Width, pictureBox4.Height);
               }
               else
               {
                   getImage.BitmapToImage(imagebytes1, pictureBox1, pictureBox1.Width, pictureBox1.Height);
                   getImage.BitmapToImage(imagebytes2, pictureBox3, pictureBox3.Width, pictureBox3.Height);
               }
               }
               else
               {
               this.pictureBox1.Image = null;
               this.pictureBox2.Image = null;
               this.pictureBox3.Image = null;
               this.pictureBox4.Image = null;
               }
        }