예제 #1
0
        ///	<summary>
        /// Initializes the source images from the specified <see cref="ImageList"/>
        ///	</summary>
        ///	<param name="imageList">The source image list</param>
        /// <remarks>
        /// <para>This method (indirectly) fires a <see cref="PropertyChange"/> event with the
        /// <see cref="ImagePanelProperties.ImagesProperty"/></para>
        /// </remarks>
        public void SetImages(ImageList imageList)
        {
            PSImgSet imageSet = new PSImgSet(imageList.ImageSize,imageList.TransparentColor) ;

            foreach(Image image in imageList.Images) {
                imageSet.Images.Add(image) ;
            }

            SetImages(imageSet) ;
        }
예제 #2
0
        /// <summary>
        /// Create an PSImgPanel using the specified <see cref="PSImgSet"/> for the
        /// source images
        /// </summary>
        /// <param name="imageSet">Source images</param>
        /// <remarks>
        /// The best dimensions (rows/cols) are calculated using <see cref="PanelSizeHints.MinimizeBoth"/>
        /// which produces the best square. The client rectangle for the <c>PSImgPanel</c> is calculated based
        /// upon the dimensions
        /// </remarks>
        public PSImgPanel(PSImgSet imageSet)
        {
            if (imageSet == null) {
                throw new ArgumentNullException("imageSet") ;
            }

            //
            // Required for Windows.Forms Class Composition Designer support
            //
            InitializeComponent();

            this.AutoScroll = true ;
            // by default, panel types are not tabstops. We change this, but the
            // user can override using TabStop property
            this.TabStop = true ;
            this.isPopup = false ;
            this.sourceImages = (Bitmap) imageSet.Preview ;
            this.imageCount = imageSet.Count ;

            Dimensions = PSImgPanel.CalculateBestDimensions(imageSet.Count,PanelSizeHints.MinimizeBoth) ;
            Size bestSize = this.CalculateBestClientSize() ;
            this.Width = bestSize.Width ;
            this.Height = bestSize.Height ;
        }
예제 #3
0
 /// <summary>
 /// Initializes the source images from the specified <see cref="PSImgSet"/>
 /// </summary>
 /// <param name="imageSet">The source image collection</param>
 /// <remarks>
 /// <para>This method (indirectly) fires a <see cref="PropertyChange"/> event with the
 /// <see cref="ImagePanelProperties.ImagesProperty"/></para>
 /// </remarks>
 public void SetImages(PSImgSet imageSet)
 {
     SetImages((Bitmap) imageSet.Preview,imageSet.Count) ;
 }