public void Compose(WallpaperComposerParameters parameters)
        {
            Image originalImage = parameters.ImageProvider.GetImage();
            Image resizedImage = parameters.ImageResizer.ResizeImage(originalImage,
                this.screenConfiguration.VirtualScreenBounds.Width,
                this.screenConfiguration.VirtualScreenBounds.Height);

            //this.SaveDebugImage(resizedImage);

            Image wallpaper = this.ComposeWallpaper(resizedImage);
            parameters.WallpaperProcessor.Process(wallpaper);
        }
Beispiel #2
0
        public void Run()
        {
            ScreenConfiguration configuration = new ScreenConfiguration(
                System.Windows.Forms.Screen.AllScreens.Select(s => new Screen(s)).ToArray(), -300); //120
            WallpaperComposer composer = new WallpaperComposer(configuration);

            WallpaperComposerParameters parameters = new WallpaperComposerParameters();
            parameters.ImageProvider = new StaticImageProvider(imagePath);
            parameters.ImageResizer = new FillingImageResizer();
            parameters.WallpaperProcessor = new ApplyingWallpaperProcessor();

            composer.Compose(parameters);
        }
Beispiel #3
0
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            new Thread(() =>
            {
                WallpaperComposerParameters parameters = new WallpaperComposerParameters();
                parameters.ImageProvider = new Adhesive.Core.Providers.StaticImageProvider(this.model.ImagePath);
                parameters.ImageResizer = this.model.ImageResizer;
                parameters.WallpaperProcessor = new Adhesive.Core.Processors.ApplyingWallpaperProcessor();

                WallpaperComposer composer = new WallpaperComposer(this.model.ScreenConfiguration);
                composer.Compose(parameters);

            }).Start();
        }