Exemplo n.º 1
0
 private void btndelete3_Click(object sender, EventArgs e)
 {
     _image3           = null;
     pictureBox3.Image = _noImage;
     //_t_imgs3 = null;
     //pictureBox3.Image = _noImage;
 }
Exemplo n.º 2
0
 private void btnDelete1_Click(object sender, EventArgs e)
 {
     _image1           = null;
     pictureBox1.Image = _noImage;
     //_t_imgs1 = null;
     //pictureBox1.Image = _noImage;
 }
Exemplo n.º 3
0
        protected void GetImages()
        {
            if (_recordId < 1)
            {
                return;
            }

            List <FishEntity.ImageEntity> images = _bll.GetModelList("recordid=" + _recordId + " and type=" + (int)_type);

            // List<FishEntity.t_image_S> imgs = blll.GetModelList("recordid=" + _recordId + " and type=" + (int)_type);

            if (images == null)
            {
                return;
            }

            foreach (FishEntity.ImageEntity item in images)
            {
                Image tempImage = Image.FromStream(new MemoryStream(item.image));

                if (item.sort == 1)
                {
                    _image1           = item;
                    pictureBox1.Image = tempImage;
                }
                else if (item.sort == 2)
                {
                    _image2           = item;
                    pictureBox2.Image = tempImage;
                }
                else if (item.sort == 3)
                {
                    _image3           = item;
                    pictureBox3.Image = tempImage;
                }
            }
            //if (imgs == null) return;
            //foreach (FishEntity.t_image_S it in imgs)
            //{
            //    Image tempImage = Image.FromStream(new MemoryStream(it.State));

            //    if (it.Type == 1)
            //    {
            //        _t_imgs1 = it;
            //        pictureBox1.Image = tempImage;
            //    }
            //    else if (it.Type == 2)
            //    {
            //        _t_imgs1 = it;
            //        pictureBox2.Image = tempImage;
            //    }
            //    else if (it.Type == 3)
            //    {
            //        _t_imgs1 = it;
            //        pictureBox3.Image = tempImage;
            //    }
            //}
        }
Exemplo n.º 4
0
        public void SetData(int recordid, ImageTypeEnum type)
        {
            _recordId = recordid;
            _type     = type;

            _image1  = _image2 = _image3 = null;
            _t_imgs1 = _t_imgs2 = _t_imgs3 = null;
            //pictureBox1.Image = pictureBox2.Image = pictureBox3.Image = _noImage;

            GetImages();
        }
Exemplo n.º 5
0
        protected void SetImage(PictureBox pic, FishEntity.ImageEntity entity)
        {
            byte[] buffers  = null;
            string ext      = string.Empty;
            string fileName = string.Empty;
            Image  img      = SelectImage(ref buffers, ref fileName, ref ext);

            entity.image     = buffers;
            entity.extension = ext;
            if (img != null)
            {
                pic.Image = img;
            }
        }
Exemplo n.º 6
0
 private void btnselect3_Click(object sender, EventArgs e)
 {
     if (_image3 == null)
     {
         _image3      = new FishEntity.ImageEntity();
         _image3.type = (int)_type;
         _image3.sort = 3;
     }
     SetImage(pictureBox3, _image3);
     //if (_t_imgs3 == null)
     //{
     //    _t_imgs3 = new FishEntity.t_image_S();
     //    _t_imgs3.Type = (int)_type;
     //    _t_imgs3.State = 3;
     //}
     //SetImage1(pictureBox3, _t_imgs3);
 }
Exemplo n.º 7
0
 private void btnselect2_Click(object sender, EventArgs e)
 {
     if (_image2 == null)
     {
         _image2      = new FishEntity.ImageEntity();
         _image2.type = (int)_type;
         _image2.sort = 2;
     }
     SetImage(pictureBox2, _image2);
     //if (_t_imgs2 == null)
     //{
     //    _t_imgs2 = new FishEntity.t_image_S();
     //    _t_imgs2.Type = (int)_type;
     //    _t_imgs2.State = 2;
     //}
     //SetImage1(pictureBox2, _t_imgs2);
 }
Exemplo n.º 8
0
 private void btnSelect1_Click(object sender, EventArgs e)
 {
     if (_image1 == null)
     {
         _image1      = new FishEntity.ImageEntity();
         _image1.type = (int)_type;
         _image1.sort = 1;
     }
     SetImage(pictureBox1, _image1);
     //if (_t_imgs1 == null)
     //{
     //    _t_imgs1 = new FishEntity.t_image_S();
     //    _t_imgs1.Type = (int)_type;
     //    _t_imgs1.State = 1;
     //}
     //SetImage1(pictureBox1, _t_imgs1);
 }