Пример #1
0
 public void ChangeThumbnailSide(int id, int side, bool isannotated, bool isCDR, string fileName)
 {
     //isannotated has been added by Darshan to solve defect no 0000527: Annotated images displaying wrong names.
     foreach (Control item in thumbnail_FLP.Controls)
     {
         if (item is ImageViewer)
         {
             ImageViewer imgView = item as ImageViewer;
             if (imgView.ImageID == id)
             {
                 imgView.ImageSide   = side;
                 this.side           = side;
                 this.isannotated    = isannotated;
                 this.isCDR          = isCDR;
                 imgView.IsAnnotated = isannotated;
                 imgView.IsCDR       = isCDR;
                 imgView.label1.Text = GetImage_Name(imgView.ImageSide, imgView.Index);
                 imgView.label1.Font = new Font("Tahoma", 10.5F, System.Drawing.FontStyle.Bold);
                 if (!string.IsNullOrEmpty(fileName))
                 {
                     imgView.ImageLocation = fileName;
                 }
                 imgView.LoadImage(imgView.ImageLocation, id, 256, 256);//Update the side changed image in thumbnail when image side is changed,added by Darshan(Defect no 0000702).
                 imgView.Refresh();
             }
         }
     }
 }
Пример #2
0
        private void AddImage(string imageFilename, int id, int indx, int side, bool isannotated, bool isCDR)
        {
            if (this.InvokeRequired)
            {
                this.Invoke(m_AddImageDelegate, imageFilename, id, indx, side, isannotated, isCDR);
                //this.BeginInvoke(m_AddImageDelegate, imageFilename, id, indx, side, isannotated, isCDR);
            }
            else
            {
                //int size = 192;
                ImageViewer imageViewer = new ImageViewer();
                imageViewer.Dock = DockStyle.Bottom;
                imageViewer.LoadImage(imageFilename, id, 256, 256);
                if (Screen.PrimaryScreen.Bounds.Width == 1366)
                {
                    imageViewer.Width  = 118;
                    imageViewer.Height = 128;
                }
                else
                if (Screen.PrimaryScreen.Bounds.Width == 1280)
                {
                    imageViewer.Width  = 118;
                    imageViewer.Height = 128;
                }
                else
                {
                    imageViewer.Width  = 192;
                    imageViewer.Height = 192;
                }
                //This below code has been added by darshan in order to solve defect no:0000530
                this.thumbnail_FLP.AutoScrollOffset = new Point(0, imageViewer.Height);
                imageViewer.IsAnnotated             = isannotated;
                imageViewer.IsCDR       = isCDR;
                imageViewer.IsThumbnail = true;
                imageViewer.MouseClick += new MouseEventHandler(imageViewer_MouseClick);
                // imageViewer.textBox1.Click += textBox1_Click;
                imageViewer.label1.Click += label1_Click;
                imageViewer.ImageLocation = imageFilename;
                imageViewer.ImageSide     = side;
                string format_string;
                //if (this.thumbnail_FLP.TotalThumbnails == 0)
                //{
                //    this.thumbnail_FLP.TotalThumbnails = 1;
                //}
                if (indx == -1)
                {
                    imageViewer.Index = this.thumbnail_FLP.TotalThumbnails;//this.thumbnail_FLP.TotalThumbnails;
                    indx = ++imageViewer.Index;
                    //imageViewer.Index = indx + 1;
                }
                else
                {
                    imageViewer.Index = indx + 1;
                }
                this.isannotated        = isannotated;
                this.isCDR              = isCDR;
                imageViewer.label1.Text = GetImage_Name(imageViewer.ImageSide, imageViewer.Index);
                imageViewer.label1.Font = new Font("Tahoma", 10.5F, System.Drawing.FontStyle.Bold);
                //if (indx == -1)
                //{
                //    imageViewer.Index = this.thumbnail_FLP.TotalThumbnails;//this.thumbnail_FLP.TotalThumbnails;
                //    indx = imageViewer.Index;
                //   // imageViewer.Index = indx + 1;

                //}
                //else
                //    imageViewer.Index = indx + 1;
                //// imageViewer.textBox1.Text = "\t\t" + this.thumbnailString + "\t\t" + imageViewer.Index.ToString();
                //imageViewer.label1.Text = this.thumbnailString + "\t\t" + imageViewer.Index.ToString();
                // imageViewer.label1.Enabled = false;
                this.OnImageSizeChanged += new ThumbnailImageEventHandler(imageViewer.ImageSizeChanged);
                //imageViewer.checkBox1.CheckedChanged += checkBox1_CheckedChanged;
                this.thumbnail_FLP.Controls.Add(imageViewer);
                this.thumbnail_FLP.Controls.SetChildIndex(imageViewer, 0);
                this.thumbnail_FLP.TotalThumbnails++;
                //if (this.isFirstThumbnail_Selected)
                //{
                //    selectThumbnail(imageViewer);
                //    this.thumbnail_FLP.Controls.SetChildIndex(imageViewer, 0);
                //    isThumbnailAddEvent = false;
                //}
            }
        }