|
-
Dec 15th, 2009, 12:05 PM
#1
Thread Starter
Addicted Member
[RESOLVED] How To Change Desktop Background Using jpg Image
hi
how to change desktop back using jpg
i got vb code to change it but Accept just bmp
this is the code
Code:
Private Declare Function SystemParametersInfo Lib "user32" Alias "SystemParametersInfoA" (ByVal uAction As Long, ByVal uParam As Long, ByVal lpvParam As String, ByVal fuWinIni As Long) As Long
Private Const SPI_SETDESKWALLPAPER = 20
Private Const SPIF_UPDATEINIFILE = &H1
Private imagePath As String
Private Sub cmdBrowse_Click()
'set a custom title to the dialog
dlg.DialogTitle = "Select the image to load."
'show the dialog
dlg.ShowOpen
'the path to get the image from
imagePath = dlg.FileName
'view the selected picture into the picturebox
'control
pic.Picture = LoadPicture(imagePath)
End Sub
Private Sub cmdSetWallPaper_Click()
SystemParametersInfo SPI_SETDESKWALLPAPER, 0, imagePath, SPIF_UPDATEINIFILE
End Sub
and i want it to change the background and Accept the both type of image
BMP & JPG
Last edited by DeadlyMan; Dec 15th, 2009 at 12:11 PM.
-
Dec 15th, 2009, 12:58 PM
#2
Re: How To Change Desktop Background Using jpg Image
You could convert the jpg to a bmp in your code.
vb Code:
'Code Not tested by me. If Right$(imagePath, 3) = "jpg" Or Right$(imagePath, 3) = "JPG" Or Right$(imagePath, 3) = _ "gif" Or Right$(imagePath, 3) = "GIF" Then pic.Picture = LoadPicture(imagePath) SavePicture pic, App.path & "\wallpaper.bmp" End If
Everything that has a computer in will fail. Everything in your life, from a watch to a car to, you know, a radio, to an iPhone, it will fail if it has a computer in it. They should kill the people who made those things.- 'Woz'
save a blobFileStreamDataTable To Text Filemy blog
-
Dec 15th, 2009, 01:05 PM
#3
Addicted Member
Re: How To Change Desktop Background Using jpg Image
Take a look this article :
Code:
http://support.microsoft.com/kb/313596
-
Dec 15th, 2009, 01:09 PM
#4
Addicted Member
Re: How To Change Desktop Background Using jpg Image
 Originally Posted by abhijit
You could convert the jpg to a bmp in your code.
vb Code:
'Code Not tested by me.
If Right$(imagePath, 3) = "jpg" Or Right$(imagePath, 3) = "JPG" Or Right$(imagePath, 3) = _
"gif" Or Right$(imagePath, 3) = "GIF" Then
pic.Picture = LoadPicture(imagePath)
SavePicture pic, App.path & "\wallpaper.bmp"
End If
Works i checked myself!
-
Dec 16th, 2009, 05:59 AM
#5
Thread Starter
Addicted Member
Re: How To Change Desktop Background Using jpg Image
Thanx For Ur Help It's Worked Fine
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|