[ opengl @ 16.05.2005. 09:53 ] @
Kako sliku bilo kog formata posatviti za pozadinu u vb.net |
[ opengl @ 16.05.2005. 09:53 ] @
[ NeznamTkoSam @ 16.05.2005. 10:41 ] @
Misliš, wallpaper?
[ opengl @ 25.05.2005. 17:35 ] @
da
[ kuzmam @ 26.05.2005. 09:55 ] @
Pazi, ono što tebi treba jeste funkcija iz Win Api-ja. Jednostavno importuješ odgovarajući dll, a to je user32.dll dok je funkcija SystemParametersInfo.
Evo koda u vb-ju: Private Const SPI_SETDESKWALLPAPER As Integer = &H14 Private Const SPIF_UPDATEINIFILE As Integer = &H1 Private Const SPIF_SENDWININICHANGE As Integer = &H2 Private Declare Auto Function SystemParametersInfo Lib "user32.dll" ( _ ByVal uAction As Integer, ByVal uParam As Integer, _ ByVal lpvParam As String, ByVal fuWinIni As Integer) As Integer Const WallpaperFile As String = "neka slika.bmp" Friend Sub SetWallpaper(ByVal img As Image) Dim imageLocation As String imageLocation = My.Computer.FileSystem.CombinePath( _ My.Computer.FileSystem.SpecialDirectories.MyPictures, WallpaperFile) Try img.Save(imageLocation, System.Drawing.Imaging.ImageFormat.Bmp) SystemParametersInfo(SPI_SETDESKWALLPAPER, 0, imageLocation, _ SPIF_UPDATEINIFILE Or SPIF_SENDWININICHANGE) Catch Ex As Exception Throw New Exception(Ex.Message) End Try End Sub Copyright (C) 2001-2025 by www.elitesecurity.org. All rights reserved.
|