Beispiel #1
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 #2
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();
        }