Beispiel #1
0
        private void ShowVideo(object violationNotificationDTO)
        {
            var    violationNotification = (ViolationNotificationDTO)violationNotificationDTO;
            string videopath             = _client.GetViolationVideoURLById(violationNotification.ViolationNotificationId);

            ImagePoupVM.SourceURL = "Video";
            //(imagePopup.DataContext as ImagePopupViewModel).VideoURL = "http://hubblesource.stsci.edu/sources/video/clips/details/images/hst_1.mpg";
            if (videopath != null)
            {
                ImagePoupVM.VideoURL = videopath;
                ImagePoupVM.ShowStream();
                //imagePopup.Show();
            }
        }
        private void ShowImage(object violationNotificationDTO)
        {
            try
            {
                IsControlBusy = true;

                var violationNotification = (ViolationNotificationDTO)violationNotificationDTO;


                List <string> imagepathList = client.GetViolationImageURLsById(violationNotification.ViolationNotificationId).ToList();

                ImagePoupVM.SourceURL = "Image";
                ImagePoupVM.ShowStream();

                IsControlBusy = false;
                // Base64ImageConverter base64Image = new Base64ImageConverter();
                if (imagepathList != null && imagepathList.Count > 0)
                {
                    //List<BitmapImage> imageBitmapList = new List<BitmapImage>();
                    //BitmapImage btm;
                    //imagepathList = new List<string>();
                    //for (int i = 0; i < 7; i++)
                    //{
                    //    imagepathList.Add(@"D:\STC.Projects.WPFControlLibrary.DrawPolygonMapControl\STC.Projects.WPFControlLibrary.DrawPolygonMapControl\Images\google-active.png");
                    //}

                    //foreach (string base64Item in imagepathList)
                    //{
                    //    btm = (BitmapImage)base64Image.Convert(base64Item, null, null, null);
                    //    imageBitmapList.Add(btm);
                    //}

                    // ImagePoupVM.ImageURLBitmap = imageBitmapList;
                    ImagePoupVM.ImageURLList = imagepathList;

                    //imagePopup.Show();
                }
            }
            catch (Exception ex)
            {
                IsControlBusy = false;
                throw ex;
            }
        }
 public void SetMediaSource()
 {
     if (SupervisorNotificationDTO.DangerousViolatorDetails != null && !string.IsNullOrEmpty(SupervisorNotificationDTO.DangerousViolatorDetails.MediaURL))
     {
         if (SupervisorNotificationDTO.DangerousViolatorDetails.MediaType == MediaTypes.Image)
         {
             ImagePoupVM.SourceURL = "Image";
             ImagePoupVM.ShowStream();
             ImagePoupVM.ImageURLList = new List <string>()
             {
                 SupervisorNotificationDTO.DangerousViolatorDetails.MediaURL
             };
         }
         else if (SupervisorNotificationDTO.DangerousViolatorDetails.MediaType == MediaTypes.Video)
         {
             ImagePoupVM.SourceURL = "Video";
             ImagePoupVM.ShowStream();
             ImagePoupVM.VideoURL = SupervisorNotificationDTO.DangerousViolatorDetails.MediaURL;
         }
     }
 }
Beispiel #4
0
        private void ShowImage(object violationNotificationDTO)
        {
            var violationNotification = (ViolationNotificationDTO)violationNotificationDTO;

            ImagePoupVM.SourceURL = "Image";
            //(imagePopup.DataContext as ImagePopupViewModel).ImageURLList = new List<string>() { "https://upload.wikimedia.org/wikipedia/commons/c/c0/Salik's_Al_Garhoud_Bridge_Toll_Gate.jpg", "https://upload.wikimedia.org/wikipedia/commons/c/c0/Salik's_Al_Garhoud_Bridge_Toll_Gate.jpg" };
            List <string> imagepathList = _client.GetViolationImageURLsById(violationNotification.ViolationNotificationId).ToList();

            //List<Byte[]> imagesBytesList = _client.GetViolationImagesById(violationNotification.ViolationNotificationId).ToList();

            //if (imagesBytesList != null && imagesBytesList.Count > 0)
            //{
            //    (imagePopup.DataContext as ImagePopupViewModel).ImagesBytesList = imagesBytesList;
            //    (imagePopup.DataContext as ImagePopupViewModel).ShowStream();
            //    imagePopup.Show();
            //}

            if (imagepathList != null && imagepathList.Count > 0)
            {
                //    List<BitmapImage> imageBitmapList = new List<BitmapImage>();
                //    Base64ImageConverter base64Image = new Base64ImageConverter();
                //    BitmapImage btm;

                //    foreach (string base64Item in imagepathList)
                //    {
                //        btm = (BitmapImage)base64Image.Convert(base64Item, null, null, null);
                //        imageBitmapList.Add(btm);
                //    }

                //    ImagePoupVM.ImageURLBitmap = imageBitmapList;
                //    ImagePoupVM.ShowStream();
                //
                //    //imagePopup.Show();


                ImagePoupVM.ImageURLList = imagepathList;
                ImagePoupVM.ShowStream();
            }
        }
        private void ShowImage(object assignedPatrol)
        {
            try
            {
                var assignedPatrolDetails = (PatrolDtoUI)assignedPatrol;

                ImagePoupVM.SourceURL = "Image";
                ImagePoupVM.ShowStream();
                if (assignedPatrolDetails.PatrolDtoObj.CurrentTaskId != 0)
                {
                    string[] imagesURL = tfmClient.GetTaskImagesURLs(assignedPatrolDetails.PatrolDtoObj.CurrentTaskId);

                    assignedPatrolDetails.ImagePathList = imagesURL.ToList();
                    if (assignedPatrolDetails.ImagePathList != null && assignedPatrolDetails.ImagePathList.Count > 0)
                    {
                        List <string>        imagepathList = assignedPatrolDetails.ImagePathList;
                        Base64ImageConverter base64Image   = new Base64ImageConverter();
                        if (imagepathList != null && imagepathList.Count > 0)
                        {
                            List <BitmapImage> imageBitmapList = new List <BitmapImage>();
                            BitmapImage        btm;


                            foreach (string base64Item in imagepathList)
                            {
                                btm = (BitmapImage)base64Image.Convert(base64Item, null, null, null);
                                imageBitmapList.Add(btm);
                            }

                            ImagePoupVM.ImageURLBitmap = imageBitmapList;
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
        private void ShowVideo(object assignedPatrol)
        {
            try
            {
                var assignedPatrolDetails = (PatrolDtoUI)assignedPatrol;

                if (assignedPatrolDetails == null)
                {
                    return;
                }
                //List<string> videopathList = tfmClient.GetTaskVideosURLs(assignedPatrolDetails.PatrolDtoObj.CurrentTaskId).ToList();

                ImagePoupVM.SourceURL = "Video";
                ImagePoupVM.ShowStream();
                if (assignedPatrolDetails.VideoPathList != null && assignedPatrolDetails.VideoPathList.Count > 0)
                {
                    //videopath = @"D:\split.mp4";
                    //ImagePoupVM.VideoURL = videopath;

                    // var videoStream = new MemoryStream(Convert.FromBase64String(str));
                    foreach (var vidPath in assignedPatrolDetails.VideoPathList)
                    {
                        //MediaPlayerWindow mplayer = new MediaPlayerWindow(@"http://13.82.52.255/WCFService/Videos/112/10.wmv");
                        //MediaPlayerWindow mplayer = new MediaPlayerWindow(vidPath);

                        //mplayer.Show();
                        //mplayer.Activate();
                        //mplayer.Focus();
                        //mplayer.Topmost = true;

                        ImagePoupVM.VideoURL = vidPath;
                    }
                }
            }
            catch (Exception ex)
            {
                //throw ex;
            }
        }
        private void ShowVideo(object violationNotificationDTO)
        {
            try
            {
                IsControlBusy = true;
                var violationNotification = (ViolationNotificationDTO)violationNotificationDTO;


                string videopath = client.GetViolationVideoURLById(violationNotification.ViolationNotificationId);

                IsControlBusy = false;

                ImagePoupVM.SourceURL = "Video";
                ImagePoupVM.ShowStream();
                //(imagePopup.DataContext as ImagePopupViewModel).VideoURL = "http://hubblesource.stsci.edu/sources/video/clips/details/images/hst_1.mpg";
                if (videopath != null)
                {
                    //videopath = @"D:\split.mp4";
                    ImagePoupVM.VideoURL = videopath;


                    //MediaPlayerWindow mplayer = new MediaPlayerWindow(videopath);
                    //mplayer.Show();

                    //mplayer.Activate();
                    //mplayer.Focus();
                    //mplayer.Topmost = true;
                    //imagePopup.Show();
                }
            }
            catch (Exception ex)
            {
                IsControlBusy = false;
                throw ex;
            }
        }