标签: wallpaper

使用c ++和windows api以编程方式更改壁纸

我一直在尝试使用Qt和mingw32编写一个应用程序来下载图像并将它们设置为背景壁纸.我已经在线阅读了几篇关于如何在VB和C#中执行此操作的文章,并且在某种程度上如何在c ++中执行此操作.我目前正在调用SystemParametersInfo看似所有正确的参数(没有编译器错误)并且它失败了.没有镲片的大崩溃,只是0返回.GetLastError()同样具有启发性0.

下面是我正在使用的代码(稍微修改一下,因此您不必查看对象内部).

#include <windows.h>
#include <iostream>
#include <QString>

void setWall()
{
    QString filepath = "C:\\Documents and Settings\\Owner\\My Documents\\Wallpapers\\wallpaper.png";
    char path[150];
    strcpy(path, currentFilePath.toStdString().c_str());
    char *pathp;
    pathp = path;

    cout << path;

    int result;
    result = SystemParametersInfo(SPI_SETDESKWALLPAPER, 0, pathp, SPIF_UPDATEINIFILE);

    if (result)
    {
        cout << "Wallpaper set";
    }
    else
    {
        cout << "Wallpaper not set";
        cout << "SPI returned" << result;
    }
}
Run Code Online (Sandbox Code Playgroud)

c++ winapi qt desktop-wallpaper wallpaper

7
推荐指数
1
解决办法
2万
查看次数

API等级3的壁纸偏移量?

我已经完成了我的小壁纸应用程序.现在唯一的事情就是我在API级别3上找不到任何偏移方法.无论我使用什么尺寸的图像,它都不在我的测试手机中.它在模拟器上看起来很棒,但对于像后空翻这样的旧手机用户怎么办?有谁知道对此有任何修复?

android screen center wallpaper

7
推荐指数
1
解决办法
433
查看次数

在程序关闭时使用批处理文件更改壁纸.可能?

我正在尝试创建一个批处理文件,该程序将在Windows 7上关闭程序时更改我的背景.我尝试使用它,但它不起作用,即使我注销并重新登录:

@echo off
reg /add HKCU\Control Panel\Desktop\WallPaper /v wallpaper /t REG_SZ /d c:\images\wallpaper.bmp
Run Code Online (Sandbox Code Playgroud)

background batch-file wallpaper windows-7

7
推荐指数
1
解决办法
7万
查看次数

即使尺寸与屏幕匹配,WallpaperManager也会缩放图像

我有一个应用程序将壁纸应用到主屏幕上,其图像与屏幕尺寸相匹配,但是在我应用它时,壁纸会放大,即使使用的图像与屏幕尺寸完全匹配!它是静态图像,在主屏幕上切换页面时甚至不滚动.奇怪的是,如果我使用内置图库应用图像,壁纸将在没有缩放的情况下正常应用(它会显示"裁剪图像"屏幕,但裁剪区域本身与图像的边缘匹配)

我使用的代码适用于整个手机阵列(星系注释,ace 2,s2等),但不适用于s3; 我想知道是否有什么可以强迫壁纸正确填满屏幕?我用来应用壁纸的当前代码是:

WallpaperManager wallpaperManager = WallpaperManager.getInstance(this);   
wallpaperManager.setWallpaperOffsets(wallpaperViewer.getApplicationWindowToken(), 0, 0);
wallpaperManager.setBitmap(BitmapFactory.decodeFile(file.getPath()));//file is jpg on sd card
Run Code Online (Sandbox Code Playgroud)

android wallpaper homescreen

7
推荐指数
1
解决办法
5617
查看次数

从Python更改Windows背景

有没有人知道用python更改Windows桌面墙纸的方法,以便更改是永久性的?我找到了这段代码

import ctypes
SPI_SETDESKWALLPAPER = 20 
ctypes.windll.user32.SystemParametersInfoA(SPI_SETDESKWALLPAPER, 0, "myimage.jpg" , 0)
Run Code Online (Sandbox Code Playgroud)

此代码有效,但一旦您注销并再次登录,背景将返回到原始图像.我更喜欢一个不需要任何注册表编辑的解决方案,我想要一些适用于Windows XP和7的东西,如果可能的话.

python windows ctypes wallpaper python-2.7

7
推荐指数
1
解决办法
8605
查看次数

W10 UWP - 将远程图像设置为桌面墙纸/锁屏

我正在尝试在我的W10 UWP应用中将远程图像设置为桌面壁纸/手机锁屏:

string name = "test_image.jpg";
Uri uri = new Uri("http://www.ucl.ac.uk/news/news-articles/1213/muscle-fibres-heart.jpg");

// download image from uri into temp storagefile
var file = await StorageFile.CreateStreamedFileFromUriAsync(name, uri, RandomAccessStreamReference.CreateFromUri(uri));

// file is readonly, copy to a new location to remove restrictions
var file2 = await file.CopyAsync(KnownFolders.PicturesLibrary);

// test -- WORKS!
//var file3 = await StorageFile.GetFileFromApplicationUriAsync(new Uri("ms-appx:///Assets/Design/1.jpg"));

// try set lockscreen/wallpaper
if (ApiInformation.IsTypePresent("Windows.Phone.UI.Input.HardwareButtons")) // Phone
    success = await UserProfilePersonalizationSettings.Current.TrySetLockScreenImageAsync(file2);
else // PC
    success = await UserProfilePersonalizationSettings.Current.TrySetWallpaperImageAsync(file2);
Run Code Online (Sandbox Code Playgroud)

file1不起作用,因为它是只读的,所以我将它复制到一个新的位置(图片库)以删除限制 - > file2.

注意: …

c# wallpaper windows-runtime win-universal-app windows-10

7
推荐指数
1
解决办法
1438
查看次数

如何在Android中设置壁纸

我使用的是Android SDK 1.6.有人能告诉我如何将图像设置为主屏幕中的壁纸.

getApplicationContext().setWallpaper(); 
Run Code Online (Sandbox Code Playgroud)

似乎不适合我.

android wallpaper

6
推荐指数
1
解决办法
1万
查看次数

桌面壁纸更改时通知?

更改桌面壁纸时是否有任何通知?

谢谢!

macos cocoa notifications wallpaper

6
推荐指数
1
解决办法
699
查看次数

如何使用 LibGDx 制作 Android 动态壁纸?

我想Android使用LibGDx. 我按照此 github 链接中的说明创建了该项目

Eclipse显示错误:

“方法createListener()类型MainActivity必须重写或实现的超类型方法”

“方法createConfig()类型MainActivity必须重写或实现的超类型方法”

并提供删除@Override注释。我的错误在哪里?

我的代码:

public class MainActivity extends AndroidLiveWallpaperService {

@Override
public ApplicationListener createListener() {
    return new Wallpaper();
}

@Override
public AndroidApplicationConfiguration createConfig () {
    return new AndroidApplicationConfiguration();
}

@Override
public void offsetChange (ApplicationListener listener, float xOffset, float yOffset, float xOffsetStep, float yOffsetStep,
    int xPixelOffset, int yPixelOffset) {
    Gdx.app.log("LiveWallpaper", "offset changed: " + xOffset + ", " …
Run Code Online (Sandbox Code Playgroud)

android wallpaper live libgdx

6
推荐指数
1
解决办法
5747
查看次数

某些设备上没有显示自定义视图中的ImageView壁纸

我目前有自定义视图的以下XML代码:

<com.pink.jazz.RootView
    android:id="@+id/rootView"
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"

    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:paddingBottom="@dimen/activity_vertical_margin"
    android:paddingLeft="@dimen/activity_horizontal_margin"
    android:paddingStart="@dimen/activity_horizontal_margin"
    android:paddingRight="@dimen/activity_horizontal_margin"
    android:paddingEnd="@dimen/activity_horizontal_margin"
    android:paddingTop="@dimen/activity_vertical_margin"
    tools:context=".MouseActivity" >

    <ImageView
        android:id="@+id/mouse_hole"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:src="@drawable/mouse_hole"
        android:visibility="gone"
    />
</com.pink.jazz.RootView>
Run Code Online (Sandbox Code Playgroud)

在某些设备(例如三星Galaxy Tab 4)上,壁纸图像mouse_hole显示正常,而在其他设备(例如Asus Transformer Infinity TF700T)上根本不显示.的知名度mouse_hole正在变为可见编程当我开始我的比赛.我的自定义视图扩展RelativeLayout.

谁能知道这里有什么问题?

android wallpaper android-custom-view imageview

6
推荐指数
1
解决办法
278
查看次数