예제 #1
0
        public void ThumbnailSelected(ThumbnailData tdata)
        {
            if (File.Exists(tdata.fileName))//This if statement has been added by sriram sir on 06-08-2015
            {
                foreach (Control item in this.thumbnail_FLP.Controls)
                {
                    if (item is ImageViewer)
                    {
                        ImageViewer img = item as ImageViewer;
                        if (img.ImageLocation == (string)tdata.fileName)//;["ThumbnailFileName"])
                        {
                            if (!image_names.Contains(img.ImageLocation))
                            {
                                image_names.Add(img.ImageLocation);
                            }
                            if (File.Exists(img.ImageLocation))
                            {
                                thumbnailSelection(img);
                            }

                            break;
                        }
                    }
                }
            }
            else
            {
                NoImages_Selected();
            }
        }
예제 #2
0
 public void NoImages_Selected()
 {
     if (this.thumbnail_FLP.SelectedThumbnailFileNames.Count == 0)
     {
         ThumbnailData data = new ThumbnailData();
         displayThumbnailImage(data);
     }
 }
예제 #3
0
        //void textBox1_Click(object sender, EventArgs e)
        //{
        //    ImageViewer img = (sender as TextBox).Parent as ImageViewer;
        //    thumbnailSelection(img);
        //}
        private void displayThumbnailImage(ThumbnailData val)
        {
            EventArgs e = new EventArgs();

            if (showImgFromThumbnail != null)
            {
                showImgFromThumbnail(val, e);
            }
        }
예제 #4
0
        private void Thumbnail_noshiftcntrlSelection(ImageViewer sender)
        {
            m_ActiveImageViewer = (ImageViewer)sender;
            if (!isValueChanged)//if the brightness or contrast has been changed in view imaging screen.
            {
                for (int i = 0; i < this.thumbnail_FLP.Controls.Count; i++)
                {
                    if ((this.thumbnail_FLP.Controls[i] is ImageViewer))
                    {
                        ImageViewer tempViewer = (ImageViewer)this.thumbnail_FLP.Controls[i];
                        if (tempViewer.ImageLocation != m_ActiveImageViewer.ImageLocation)
                        {
                            tempViewer.IsActive = false;
                            if (image_names.Count > 0)
                            {
                                image_names.Clear();
                            }

                            this.thumbnail_FLP.selectedThumbnails.Remove(tempViewer.Index);
                            this.thumbnail_FLP.SelectedThumbnailFileNames.Remove(tempViewer.ImageLocation);
                        }
                    }
                }
                m_ActiveImageViewer.IsActive = true;
                if (!image_names.Contains(m_ActiveImageViewer.ImageLocation))
                {
                    image_names.Add(m_ActiveImageViewer.ImageLocation);
                }
                if (!this.thumbnail_FLP.selectedThumbnails.Contains(m_ActiveImageViewer.Index))
                {
                    this.thumbnail_FLP.selectedThumbnails.Add(m_ActiveImageViewer.Index);
                }
                if (!this.thumbnail_FLP.SelectedThumbnailFileNames.Contains(m_ActiveImageViewer.ImageLocation))//checks if SelectedThumbnailFileNames contains ImageLocation, if it doesn't contain , then adds the ImageLocation.By Ashutosh 06-09-2017.

                {
                    this.thumbnail_FLP.SelectedThumbnailFileNames.Add(m_ActiveImageViewer.ImageLocation);
                }
            }
            // this.thumbnail_FLP.AutoScrollPosition = m_ActiveImageViewer.Location;
            // if (arg == null)
            {
                //_eventHandler.Notify(_eventHandler.SetImagingScreen, arg);
                //IVLVariables.ActiveImageID = m_ActiveImageViewer.ImageID;

                ThumbnailData data = new ThumbnailData();
                data.fileName = m_ActiveImageViewer.ImageLocation;
                data.id       = m_ActiveImageViewer.ImageID;
                data.side     = m_ActiveImageViewer.ImageSide;
                data.Name     = m_ActiveImageViewer.ImageName;
                displayThumbnailImage(data);
            }
        }
예제 #5
0
        public void AddThumbnailEvent(ThumbnailData thumbnailData)
        {
            isThumbnailAddEvent = true;
            AddImage(thumbnailData.fileName, thumbnailData.id, -1, thumbnailData.side, thumbnailData.isAnnotated, thumbnailData.isCDR);
            // imageadded(val);
            imageaddedThumbnailData(thumbnailData);
            ImageViewer img = new ImageViewer();

            img.ImageLocation = thumbnailData.fileName;
            if (!thumbnailData.isModified)
            {
                ThumbnailSelected(img.ImageLocation);
            }
            //  thumbnailSelection(img);
        }
예제 #6
0
        private void ShiftKeyThumbNailSelection(ImageViewer sender)
        {
            m_ActiveImageViewer = (ImageViewer)sender;
            int startIndx = 0;
            int endIndx   = 0;

            if (this.thumbnail_FLP.selectedThumbnails.Count == 0)
            {
                Thumbnail_noshiftcntrlSelection(sender);
            }
            else
            {
                if (m_ActiveImageViewer.Index > this.thumbnail_FLP.selectedThumbnails[0])
                {
                    startIndx = this.thumbnail_FLP.selectedThumbnails[0];
                    endIndx   = m_ActiveImageViewer.Index;
                }
                else
                {
                    endIndx   = this.thumbnail_FLP.selectedThumbnails[0];
                    startIndx = m_ActiveImageViewer.Index;
                }
            }
            //for (int i = startIndx; i <= endIndx; i++)
            //{
            //Added by darshan to resolve the issue 0000657: Reports no limit is set,No images are shown.
            uint noOfImagesSelected = (uint)(endIndx - startIndx);
            //if ((noOfImagesSelected + 1) <= NoOfImagesToBeSelected && this.thumbnail_FLP.selectedThumbnails.Count < NoOfImagesToBeSelected)// && (this.thumbnail_FLP.selectedThumbnails.Count + noOfImagesSelected) <= NoOfImagesToBeSelected)
            {
                for (int i = endIndx; i >= startIndx; --i)
                {
                    foreach (Control item in this.thumbnail_FLP.Controls)
                    {
                        if (item is ImageViewer)
                        {
                            ImageViewer tempImgViewer = (ImageViewer)item;
                            if (tempImgViewer.Index == i)
                            {
                                if (!image_names.Contains(tempImgViewer.ImageLocation))
                                {
                                    image_names.Add(tempImgViewer.ImageLocation);
                                }
                                ThumbnailData data = new ThumbnailData();
                                data.fileName = m_ActiveImageViewer.ImageLocation;
                                data.id       = m_ActiveImageViewer.ImageID;
                                data.side     = m_ActiveImageViewer.ImageSide;
                                data.Name     = m_ActiveImageViewer.ImageName;
                                displayThumbnailImage(data);
                                //verticalSroll(tempImgViewer);
                                tempImgViewer.IsActive = true;
                                //this.thumbnail_FLP.AutoScrollPosition = new Point(tempImgViewer.Location.X, tempImgViewer.Location.Y+10);
                                if (!this.thumbnail_FLP.selectedThumbnails.Contains(tempImgViewer.Index))
                                {
                                    this.thumbnail_FLP.selectedThumbnails.Add(tempImgViewer.Index);
                                }
                                if (!this.thumbnail_FLP.SelectedThumbnailFileNames.Contains(tempImgViewer.ImageLocation))//checks if SelectedThumbnailFileNames contains ImageLocation, if it doesn't contain , then adds the ImageLocation.By Ashutosh 06-09-2017.
                                {
                                    this.thumbnail_FLP.SelectedThumbnailFileNames.Add(tempImgViewer.ImageLocation);
                                }
                            }
                        }
                    }
                }
            }
            //else
            //{
            //    //Added by darshan to resolve the issue 0000657: Reports no limit is set,No images are shown Note no (0002575).
            //    CustomMessageBox.Show(NoOfImagesToBeSelectedText1 + " " + NoOfImagesToBeSelected.ToString() + " " + NoOfImagesToBeSelectedText2, NoOfImagesToBeSelectedHeader, CustomMessageBoxButtons.OK, CustomMessageBoxIcon.Information);
            //}
        }
예제 #7
0
        private void ControlKeyThumbNailSelection(ImageViewer sender)
        {
            m_ActiveImageViewer = (ImageViewer)sender;
            if (this.thumbnail_FLP.selectedThumbnails.Contains(m_ActiveImageViewer.Index))
            {
                m_ActiveImageViewer.IsActive = false;
                int imagename_index;
                //if (image_names.Last() == m_ActiveImageViewer.ImageLocation && image_names.First() == m_ActiveImageViewer.ImageLocation)
                //{
                imagename_index = image_names.IndexOf(m_ActiveImageViewer.ImageLocation);
                //}
                //else
                //    if (image_names.Last() == m_ActiveImageViewer.ImageLocation)
                //    {
                //        imagename_index = image_names.IndexOf(m_ActiveImageViewer.ImageLocation);
                //        imagename_index--;
                //    }
                //    else
                //    {
                //        imagename_index = image_names.IndexOf(m_ActiveImageViewer.ImageLocation);
                //    }
                image_names.Remove(m_ActiveImageViewer.ImageLocation);
                this.thumbnail_FLP.selectedThumbnails.Remove(m_ActiveImageViewer.Index);
                this.thumbnail_FLP.SelectedThumbnailFileNames.Remove(m_ActiveImageViewer.ImageLocation);
                Dictionary <string, object> thumbNailDic = new Dictionary <string, object>();
                if (image_names.Count != 0)
                {
                    //image_names.Reverse();
                    foreach (Control item in this.thumbnail_FLP.Controls)
                    {
                        if (item is ImageViewer)
                        {
                            ImageViewer imgViewer = item as ImageViewer;
                            if (imgViewer.ImageLocation == image_names[image_names.Count - 1])
                            {
                                ThumbnailData data = new ThumbnailData();
                                data.fileName = imgViewer.ImageLocation;
                                data.id       = imgViewer.ImageID;
                                data.side     = imgViewer.ImageSide;
                                data.Name     = imgViewer.ImageName;
                                displayThumbnailImage(data);
                            }
                        }
                    }
                }
                else
                {
                    NoImages_Selected();
                }
            }
            else
            {
                //if (this.thumbnail_FLP.SelectedThumbnailFileNames.Count < NoOfImagesToBeSelected)
                {
                    m_ActiveImageViewer.IsActive = true;
                    //this.thumbnail_FLP.AutoScrollPosition = m_ActiveImageViewer.Location;
                    {
                        if (!image_names.Contains(m_ActiveImageViewer.ImageLocation))//This condition has been added to prevent the unnecessary addition same image into image_names when the image is already present.
                        {
                            image_names.Add(m_ActiveImageViewer.ImageLocation);
                        }
                        ThumbnailData data = new ThumbnailData();
                        data.fileName = m_ActiveImageViewer.ImageLocation;
                        data.id       = m_ActiveImageViewer.ImageID;
                        data.side     = m_ActiveImageViewer.ImageSide;
                        data.Name     = m_ActiveImageViewer.ImageName;
                        displayThumbnailImage(data);
                    }
                    if (!this.thumbnail_FLP.selectedThumbnails.Contains(m_ActiveImageViewer.Index))
                    {
                        this.thumbnail_FLP.selectedThumbnails.Add(m_ActiveImageViewer.Index);
                    }

                    if (!this.thumbnail_FLP.SelectedThumbnailFileNames.Contains(m_ActiveImageViewer.ImageLocation))//checks if SelectedThumbnailFileNames contains ImageLocation, if it doesn't contain , then adds the ImageLocation.By Ashutosh 06-09-2017.
                    {
                        this.thumbnail_FLP.SelectedThumbnailFileNames.Add(m_ActiveImageViewer.ImageLocation);
                    }
                    ////else
                    //    //Added by darshan to resolve the issue 0000657: Reports no limit is set,No images are shown Note no (0002575).
                    //    CustomMessageBox.Show(NoOfImagesToBeSelectedText1 + " " + NoOfImagesToBeSelected.ToString() + " " + NoOfImagesToBeSelectedText2, NoOfImagesToBeSelectedHeader, CustomMessageBoxButtons.OK, CustomMessageBoxIcon.Information);
                }
            }
        }