Beispiel #1
0
        void LoadImagesAsync(string[] files)
        {
            for (int i = 0; i < files.Length; i++)
            {
                if (_images != null)
                {
                    var image = Image.FromFile(files[i]);

                    lock (_images)
                    {
                        _maxImageSize = new Size(
                            Math.Max(_maxImageSize.Width, image.Width),
                            Math.Max(_maxImageSize.Height, image.Height));

                        var animatedImage = new AnimatedImage(
                            this,
                            image,
                            new Point(i % Columns * _maxImageSize.Width, i / Columns * _maxImageSize.Height));

                        _images.Add(animatedImage);
                        animatedImage.BeginAnimation();
                    }
                }
            }
        }