[JAVA] Since the image of the lock screen of Windows 10 is beautiful, I wanted to make it a slide show of wallpaper

Isn't the image of the lock screen of Windows 10 beautiful?

The image of the lock screen of Windows 10 is beautiful and it changes regularly, so it's good. Wouldn't it be great if you could stock this up and slideshow it with wallpaper? I'm happy.

4b6e60030cde390047c7001ee5975ed7f65a64d2e41daf818a450fe609cf6612.jpg _ Such a guy _

Try to find out where it is stored

When I asked Mr. Google, it seems that it is on the following pass. C: \ Users \ (user name) \ AppData \ Local \ Packages \ Microsoft.Windows.ContentDeliveryManager_cw5n1h2txyewy \ LocalState \ Assets

By the way, it seems that you can also go by typing the following with Run (Win + R) by specifying the file name. %LOCALAPPDATA%\Packages\Microsoft.Windows.ContentDeliveryManager_cw5n1h2txyewy\LocalState\Assets

Actually look inside the folder

It doesn't have an extension, it looks like the size of the file, it's probably not the size that makes it a wallpaper, or maybe it's an image that seems to be used as an icon. 1.png

For the time being, if you add .jpg to the file, it will be recognized as an image. 2.png

Copy to My Picture by separating only those that can be used as jpg

For the time being, the path of My Pictures is "C: \ Users \ (user name) \ Pictures ".

//Path separator
String spa = FileSystems.getDefault().getSeparator();

//Copy source folder
Path fromFolder = Paths.get("C:\\Users\\Kerlon\\AppData\\Local\\Packages\\Microsoft.Windows.ContentDeliveryManager_cw5n1h2txyewy\\LocalState\\Assets\\");
//Copy destination folder
Path toFolder = Paths.get("C:\\Users\\Kerlon\\Pictures\\");

//Loop on the file at the copy source
for (String fileName : fromFolder.toFile().list()) {
    //Import the file as an image
    BufferedImage image = ImageIO.read(new File(fromFolder + spa + fileName));

    //For 1920x1080 size
    if (image.getWidth() == 1920) {
        //Copy source file
        Path fromFile = Paths.get(fromFolder.toFile().getAbsolutePath() + spa + fileName);
        //Copy destination file(extension.Add jpg)
        Path toFile = Paths.get(toFolder.toFile().getAbsolutePath() + spa + fileName + ".jpg ");

        //Confirm the existence for the time being
        if (!toFile.toFile().exists()) {
            //Copy execution
            Files.copy(fromFile, toFile);
        }
    }
}

I'm glad that I was able to copy only the 1920x1080 size image to My Picture. 3.png

Tweak Windows wallpaper settings

Right-click on an empty area of the desktop and select "Personalize". 4.png

Make the following settings

--"Background" to "Slideshow" --"Choose a slideshow album" to "Picture" ――The rest is as you like

5.png

Make it run on a regular basis

Insert the executable file into the startup. If you do this, it will be executed automatically at startup. For those who do not turn off the power of the PC, it is recommended to use "windows start menu-> all programs-> accessories-> system tools-> task scheduler". 6.png

Congratulations

7.png

Recommended Posts

Since the image of the lock screen of Windows 10 is beautiful, I wanted to make it a slide show of wallpaper
Since the Rspec command is troublesome, I tried to make it possible to execute Rspec with one Rake command
It was a life I wanted to reset the thread-safe associative counter
I wanted to implement a slide show in a fashionable way with slick.
Make a margin to the left of the TextField
I wanted to make (a == 1 && a == 2 && a == 3) true in Java
Since the argument of link_to is nil (null) and an unexpected link was generated, I tried to verify it
[Ruby] I want to make a program that displays today's day of the week!
Since I use it often, I make a note of DB related things on Android.
If you want to make a Java application a Docker image, it is convenient to use jib.
I tried to make the sample application into a microservice according to the idea of the book "Microservice Architecture".
I tried to make a message function of Rails Tutorial extension (Part 2): Create a screen to display
Transition using the header image of CardView as it is
I just wanted to make a Reactive Property in Java
I tried to make a client of RESAS-API in Java
I tried to make it possible to set the delay for the UDP client of Android by myself
I want to make the frame of the text box red when there is an input error
I made a GitHub Action that makes it easy to understand the execution result of RSpec
I want to create a chat screen for the Swift chat app!
I made a gem to post the text of org-mode to qiita
I wanted to make JavaFX programming easier with the Spring Framework
[Java] I tried to make a maze by the digging method ♪
How to identify the path that is easy to make a mistake
A story that I wanted to write a process equivalent to a while statement with the Stream API of Java8
I tried to make a sample program using the problem of database specialist in Domain Driven Design