Beispiel #1
0
        public PreviewTileCollection GetImages()
        {
            PreviewTileCollection tiles = new PreviewTileCollection();

            foreach (PreviewTile tile in this._tiles)
            {
                tiles.Add(tile);
            }
            return(tiles);
        }
Beispiel #2
0
 // Methods
 public PrintJob(int id, PreviewTileCollection images, string format, FilmSize size, FilmOrientation orien, int copies, Printer printer)
 {
     this._id        = id;
     this._images    = images;
     this._format    = format;
     this._filmSize  = size;
     this._filmOrien = orien;
     this._copies    = copies;
     this._printer   = printer;
 }
        private Size CalcMaxSize(string format, PreviewTileCollection tiles)
        {
            Size   size = new Size(0, 0);
            string str  = format.Substring(0, 3);

            if (str.Equals("ROW"))
            {
                string[] strArray = format.Substring(4).Split(new char[] { ',' });
                int      length   = strArray.Length;
                int      index    = 0;
                foreach (string str2 in strArray)
                {
                    int  count = Convert.ToInt32(str2);
                    Size size2 = this.CalcPartSize(tiles, count, index);
                    size.Width  = (size.Width < (count * size2.Width)) ? (count * size2.Width) : size.Width;
                    size.Height = (size.Height < (length * size2.Height)) ? (length * size2.Height) : size.Height;
                    index      += count;
                }
                return(size);
            }
            if (str.Equals("COL"))
            {
                string[] strArray2 = format.Substring(4).Split(new char[] { ',' });
                int      num4      = strArray2.Length;
                int      num5      = 0;
                foreach (string str3 in strArray2)
                {
                    int  num6  = Convert.ToInt32(str3);
                    Size size3 = this.CalcPartSize(tiles, num6, num5);
                    size.Width  = (size.Width < (num4 * size3.Width)) ? (num4 * size3.Width) : size.Width;
                    size.Height = (size.Height < (num6 * size3.Height)) ? (num6 * size3.Height) : size.Height;
                    num5       += num6;
                }
                return(size);
            }
            string[] strArray3 = format.Substring(9).Split(new char[] { ',' });
            int      num7      = Convert.ToInt32(strArray3[0]);
            int      num8      = Convert.ToInt32(strArray3[1]);
            Size     size4     = this.CalcPartSize(tiles, tiles.Count, 0);

            size.Width  = num7 * size4.Width;
            size.Height = num8 * size4.Height;

            if (size.Width > 5000 || size.Height > 5000)
            {
                size.Width  = (int)(size.Width * 0.3);
                size.Height = (int)(size.Height * 0.3);
                Platform.Log(LogLevel.Error, "the sizevalue is " + size.ToString());
            }
            return(size);
        }
        private List <string> GetStudyInstanceUIDs(PreviewTileCollection tiles)
        {
            List <string> list = new List <string>();

            foreach (PreviewTile tile in tiles)
            {
                string            item      = string.Empty;
                IImageSopProvider imageData = tile.ImageData as IImageSopProvider;
                if (imageData != null)
                {
                    item = imageData.ImageSop.StudyInstanceUid;
                }
                if ((item != string.Empty) && !list.Contains(item))
                {
                    list.Add(item);
                }
            }
            return(list);
        }
        private Size CalcPartSize(PreviewTileCollection tiles, int count, int index)
        {
            Size size = new Size(0, 0);
            int  num  = 0;

            while (num < count)
            {
                if (tiles[index].ImageData != null)
                {
                    Bitmap printImagePixel = tiles[index].GetPrintImagePixel(false);
                    int    width           = printImagePixel.Width;
                    int    height          = printImagePixel.Height;
                    size.Width  = (size.Width < width) ? width : size.Width;
                    size.Height = (size.Height < height) ? height : size.Height;
                    printImagePixel.Dispose();
                }
                num++;
                index++;
            }
            return(size);
        }
 public PrintJob CreateJob(PreviewTileCollection tiles)
 {
     return new PrintJob(this.printListKey++, tiles, TilesComponent.Format, this.PrintedFilmSize, FilmOrientation, Convert.ToInt32(this.NumberOfCopies), this._selectedPrinter);
 }