Creating WallPapers using c#

Tell me how to create WallPapers using c#



Answer this question

Creating WallPapers using c#

  • Graeme Williams

    What do you mean with creating wallpapers Just creating images You can create and manipulate images with GDI+.


  • SHAAS

    Probably what you mean is how to set the wall paper programmatically, right
    if so, you can achieve this by P/Invoke:

    [DllImport("user32.dll", CharSet = CharSet.Auto)]
    private static extern Int32 SystemParametersInfo(UInt32 uiAction, UInt32 uiParam, String pvParam, UInt32 fWinIni);
    private static UInt32 SPI_SETDESKWALLPAPER = 20;
    private static UInt32 SPIF_UPDATEINIFILE = 0x1;
    private String imageFileName = "c:\\sample.bmp";

    then you can call this method directly:

    SystemParametersInfo(SPI_SETDESKWALLPAPER, 0, imageFileName, SPIF_UPDATEINIFILE);

    Note: this only works for BMP image.

    Sheva



  • Creating WallPapers using c#