Example #1
0
        /// <summary>
        /// Creates the image list with shape images using
        /// the current control settings.
        /// </summary>
        private void CreateImages()
        {
            this.ImageList = null;

            // Create the image list
            images                  = new ImageList();
            images.ImageSize        = imageSize;
            images.TransparentColor = SystemColors.Control;

            // Create a temporary hidden flowchart object
            FlowChart chart = new FlowChart();

            chart.MeasureUnit = GraphicsUnit.Pixel;
            chart.DrawBox    += this.DrawBox;

            System.Drawing.Brush back =
                new System.Drawing.SolidBrush(SystemColors.Control);

            // Populate the image list
            if (shapes == null || shapes.Length == 0)
            {
                // show all shapes
                foreach (ShapeTemplate template in ShapeTemplate.Shapes)
                {
                    createImage(template, back, chart);
                }
            }
            else
            {
                // show specified shapes
                foreach (string id in shapes)
                {
                    createImage(ShapeTemplate.FromId(id), back, chart);
                }
            }

            back.Dispose();
            chart.Dispose();
        }