wallpaper

How to make a batch file that changes the wallpaper of a computer

守給你的承諾、 提交于 2019-11-26 23:41:26
问题 I want to create a batch file that is later going to be converted to an exe that changes the wallpaper of my computer as soon as I open it. Sorry I have no idea how to do this D: 回答1: The usual answer to this question is reg add "HKCU\Control Panel\Desktop" /v Wallpaper /t REG_SZ /d "c:\somewhere\something.bmp" /f to set the adecuated entry in the registry, followed by RUNDLL32.EXE user32.dll,UpdatePerUserSystemParameters to inform the system of the changes. BUT , from windows Vista this

Android shared preferences not saving

隐身守侯 提交于 2019-11-26 20:19:21
问题 I've created an Android live wallpaper and i'm trying to let a user choose an image from their phone and apply it as a background image, but when I launch the activity that start the intent to pick the images, my shared preferences don't seem to save properly. Below is my onCreate method of the activity I start when the users presses the preference button, and the onActivityResult which gets the path of the image on the device (all that seems to work). The println after I commit the

How to set android lock screen image

心已入冬 提交于 2019-11-26 14:39:03
I'm just getting started with android programming, and want to see if there is a way to programmatically set the lock screen image. I've found various ways of setting the wallpaper in the API, but I can't seem to find the equivalent ways of setting the lock screen image. I've seen various posts saying that customising the lock screen by adding widgets or bits of applications is not possible, but surely there must be a way to set the image programmatically? Cheers, Robin There is no "lock screen image" in Android. There most certainly is no "lock screen image" concept that is the same between

Android - how to set the wallpaper image

只谈情不闲聊 提交于 2019-11-26 11:48:26
Is it possible to set the android wallpaper image programatically? I'd like to create a service that downloads an image from the web and updates the home screen wallpaper periodically. From this page on the developer site: public void setStream (InputStream data) Change the current system wallpaper to a specific byte stream. The give InputStream is copied into persistent storage and will now be used as the wallpaper. Currently it must be either a JPEG or PNG image. If you have image URL then use WallpaperManager wpm = WallpaperManager.getInstance(context); InputStream ins = new URL("absolute

Change desktop wallpaper using code in .NET

一笑奈何 提交于 2019-11-26 11:35:44
How can I change the desktop wallpaper using C# Code? Neil N Here's a class yanked from an app I wrote a year or two ago: public sealed class Wallpaper { Wallpaper() { } const int SPI_SETDESKWALLPAPER = 20; const int SPIF_UPDATEINIFILE = 0x01; const int SPIF_SENDWININICHANGE = 0x02; [DllImport("user32.dll", CharSet = CharSet.Auto)] static extern int SystemParametersInfo(int uAction, int uParam, string lpvParam, int fuWinIni); public enum Style : int { Tiled, Centered, Stretched } public static void Set(Uri uri, Style style) { System.IO.Stream s = new System.Net.WebClient().OpenRead(uri

How to set android lock screen image

元气小坏坏 提交于 2019-11-26 02:57:41
问题 I\'m just getting started with android programming, and want to see if there is a way to programmatically set the lock screen image. I\'ve found various ways of setting the wallpaper in the API, but I can\'t seem to find the equivalent ways of setting the lock screen image. I\'ve seen various posts saying that customising the lock screen by adding widgets or bits of applications is not possible, but surely there must be a way to set the image programmatically? Cheers, Robin 回答1: There is no

Android - how to set the wallpaper image

风流意气都作罢 提交于 2019-11-26 02:36:19
问题 Is it possible to set the android wallpaper image programatically? I\'d like to create a service that downloads an image from the web and updates the home screen wallpaper periodically. 回答1: From this page on the developer site: public void setStream (InputStream data) Change the current system wallpaper to a specific byte stream. The give InputStream is copied into persistent storage and will now be used as the wallpaper. Currently it must be either a JPEG or PNG image. 回答2: If you have

Change desktop wallpaper using code in .NET

…衆ロ難τιáo~ 提交于 2019-11-26 02:28:44
问题 How can I change the desktop wallpaper using C# Code? 回答1: Here's a class yanked from an app I wrote a year or two ago: public sealed class Wallpaper { Wallpaper() { } const int SPI_SETDESKWALLPAPER = 20; const int SPIF_UPDATEINIFILE = 0x01; const int SPIF_SENDWININICHANGE = 0x02; [DllImport("user32.dll", CharSet = CharSet.Auto)] static extern int SystemParametersInfo(int uAction, int uParam, string lpvParam, int fuWinIni); public enum Style : int { Tiled, Centered, Stretched } public static

How to convert a Drawable to a Bitmap?

送分小仙女□ 提交于 2019-11-25 22:23:12
问题 I would like to set a certain Drawable as the device\'s wallpaper, but all wallpaper functions accept Bitmap s only. I cannot use WallpaperManager because I\'m pre 2.1. Also, my drawables are downloaded from the web and do not reside in R.drawable . 回答1: This piece of code helps. Bitmap icon = BitmapFactory.decodeResource(context.getResources(), R.drawable.icon_resource); Here a version where the image gets downloaded. String name = c.getString(str_url); URL url_value = new URL(name);