Ejemplo n.º 1
0
        /*Summary
         * The callback routine delegated to Image view
         */
        public void ImageView()
        {
            Bitmap SourceImage = CreateBitmap(M280DEF.Image_Xsize, M280DEF.Image_Ysize, M280DEF.PixFormat);

            // Adjust Angle
            //ST: Comment as we move the code to service
            //if (chkTiltAdj.Checked == true)
            //{
            //    SourceImage = Utilities.RotateImage(SourceImage, new PointF((float)(this.DatumPos_sX + this.CropSize_X / 2),
            //                                (float)(this.DatumPos_sY + this.CropSize_Y / 2)), (byte)this.AngleInfo);
            //}

            // Crop Image
            Rectangle CropRect = new Rectangle(this.DatumPos_sX, this.DatumPos_sY,
                                               this.CropSize_X, this.CropSize_Y);

            this.CroppedImage = SourceImage.Clone(CropRect, M280DEF.PixFormat);

            SourceImage.Dispose();
            //ST: Comment as we move the code to service
            //this.picImage.Image = this.CroppedImage;

            //Ankit
            //System.IO.MemoryStream stream = new System.IO.MemoryStream();
            //SourceImage.Save(stream, System.Drawing.Imaging.ImageFormat.Jpeg);
            //byte[] imageBytes = stream.ToArray();

            //string base64String = Convert.ToBase64String(imageBytes);



            IHubContext hubContext = GlobalHost.ConnectionManager.GetHubContext <MyHub>();

            var vv = new GuestImages
            {
                ImageBase64 = saveJpeg(this.CroppedImage, (long)70)
            };

            hubContext.Clients.All.sendGuestImageObject(vv);
        }
Ejemplo n.º 2
0
 public void SendGuestImageObject(GuestImages img)
 {
     Clients.All.sendGuestImageObject(img);
 }