public void Layout(FilmSize filmSize, FilmOrientation filmOrientation)
        {
            float w = 1;
            float h = 1;

            if (filmSize != null)
            {
                if (filmOrientation == FilmOrientation.Landscape) //horizontal film position
                {
                    h = filmSize.GetWidth(FilmSize.FilmSizeUnit.Inch);
                    w = filmSize.GetHeight(FilmSize.FilmSizeUnit.Inch);
                }
                else
                {
                    w = filmSize.GetWidth(FilmSize.FilmSizeUnit.Inch);
                    h = filmSize.GetHeight(FilmSize.FilmSizeUnit.Inch);
                }
            }

            RootImageBox                     = new PrintViewImageBox();
            RootImageBox.ImageViewer         = this;
            RootImageBox.NormalizedRectangle = new RectangleF(0, 0, w, h);
            SetTileGrid(ImageDisplayFormat.Standard_1x1);
            //RootImageBox.DisplaySet = new DisplaySet();
        }
        public void ImageBoxSizeChanged(FilmSize filmSize, FilmOrientation filmOrientation)
        {
            float w = 1;
            float h = 1;

            if (filmSize != null)
            {
                if (filmOrientation == FilmOrientation.Landscape) //horizontal film position
                {
                    h = filmSize.GetWidth(FilmSize.FilmSizeUnit.Inch);
                    w = filmSize.GetHeight(FilmSize.FilmSizeUnit.Inch);
                }
                else
                {
                    w = filmSize.GetWidth(FilmSize.FilmSizeUnit.Inch);
                    h = filmSize.GetHeight(FilmSize.FilmSizeUnit.Inch);
                }
            }

            RootImageBox.NormalizedRectangle = new RectangleF(0, 0, w, h);
            EventsHelper.Fire(_layoutCompletedEvent, this, EventArgs.Empty);
            this.RootImageBox.Draw();
        }
        public static Size FilmBoxSize(FilmSize filmSizeId, int filmDPI, FilmOrientation filmOrientation)
        {
            if (filmSizeId == null)
            {
                return(Size.Empty);
            }

            var physicalWidthInInches  = filmSizeId.GetWidth(FilmSize.FilmSizeUnit.Inch);
            var physicalHeightInInches = filmSizeId.GetHeight(FilmSize.FilmSizeUnit.Inch);

            var width  = (int)Math.Ceiling(physicalWidthInInches * filmDPI);
            var height = (int)Math.Ceiling(physicalHeightInInches * filmDPI);

            return(filmOrientation == FilmOrientation.Landscape
                ? new Size(height, width)
                : new Size(width, height)); // default portrait, even if the value is None
        }