0

I know, a lot of people already asked how to change the desktop wallpaper, and I found a particular well-working example in this post: Can I change my Windows desktop wallpaper programmatically in Java/Groovy?

HOWEVER, I wish to change my wallpaper every second: simply load in a template, draw a clock and other data in it, save it to disk, point windows to the new file so it can use it as a wallpaper. This seems very "hacky" as a wallpaper is written multiple times per second to disk. Is there a way where I can point the OS to the BufferedImage instead of saving it to disk?

Community
  • 1
  • 1
Héctor van den Boorn
  • 1,218
  • 13
  • 32

1 Answers1

1

As far as I know you cannot do this, and even if there was a function to do it, it would not really be as "unhacky" as you appear to think it would be, because that function would have to work by saving your image to a file. You see, windows must be able to find the desktop wallpaper after the next reboot, so it must be kept in a file somewhere. So, what if you go through the hassle of saving the image to the file, versus Windows going through the same hassle? Both approaches are equivalently hacky.

Mike Nakis
  • 56,297
  • 11
  • 110
  • 142