Results 1 to 4 of 4
  1. #1
    Platinum Lounger
    Join Date
    Feb 2001
    Location
    Yilgarn region of Toronto, Ontario
    Posts
    5,453
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Harvesting Images for Random Desktop Wallpaper (Wo

    http://www.wopr.com/cgi-bin/w3t/showflat.p...t&Number=311193

    > Chris, I like the idea of random wallpapers - how do you do that, pls?

    The attached NotePad file spells it out in sufficient detail to let you make a decision.

    In brief there are three phases:

    1) AUTOMATICALLY Setting DOS environment variablers to record the hour, minute and second of the latest boot

    2) AUTOMATICALLY Using these variables to copy a selected BMP file to a fixed file DAILY.BMP, which has previously been set as the desktop wallpaper and

    3) Periodically running a Word97/VBA template to harvest and reorganise images from a variety of sources.

    The relevant code is built on a posting made by Kevin at least two years ago:-

    <pre> On Error GoTo Failed ' if it can't be loaded, we don't want it
    frmMe.Image1.Picture = LoadPicture(strFileName) ' load the picture
    ' Ignore Image types 2, 3 and 4 - they can't be loaded as wallpaper.
    If frmMe.Image1.Picture.Type = 2 Then GoTo Failed ' black & white
    If frmMe.Image1.Picture.Type = 3 Then GoTo Failed
    If frmMe.Image1.Picture.Type = 4 Then GoTo Failed ' black & white
    On Error Resume Next
    If frmMe.Image1.Picture.hPal <> 0 Or frmMe.Image1.Picture.Type <> 1 Then
    ' We have yet one more unknown type. This is how I learned about "2, 3 and 4" above.
    MsgBox frmMe.Image1.Picture.hPal & frmMe.Image1.Picture.Type
    Else
    End If
    </pre>


  2. #2
    Silver Lounger
    Join Date
    Jun 2001
    Location
    Morden, Surrey, United Kingdom
    Posts
    1,838
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Re: Harvesting Images for Random Desktop Wallpaper (Wo

    <img src=/S/sad.gif border=0 alt=sad width=15 height=15> but I was only asking ...!

    Only kidding. Anyway, having read your notepad file, yes, I still love the idea and would appreciate the 'tutorial' - a couple of questions come to mind -
    <UL><LI>I presume a copy of the desktop shortcut that deletes the file and assigns a new one could be set up that would change the wallpaper without deleting it?
    <LI>And could it be set to change the wallpaper automatically more often than on a reboot? Only my machine is on 24/7 and I might not reboot for several days![/list]I only wish I could come up with such clever applications of the tidbits of info I learn here, too!

    Hey, maybe you should put together a Windows version with a pretty interface and lots of options and sell it through Tucows! Just kidding again, honest!

    Many thanks
    Beryl M


  3. #3
    Platinum Lounger
    Join Date
    Feb 2001
    Location
    Yilgarn region of Toronto, Ontario
    Posts
    5,453
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Harvesting Images for Random Desktop Wallpaper

    Orright. Try downloading as (I think) http://www.vif.com/users/cgreaves/download/20031110.zip

    If I've done it right, you'll get a PKZIP25 file with a slew of stuff. read the TUTORIAL.DOC and get each piece working separately.

    1) Not until you have about 3,600 images will you see it REALLY work, so round up all those stray CDs and begin ripping images.

    2) setting the date/time environment variables is independant of the otjher stuff, so you can implement that while you get the rest working.


    3) A FAST way to get to 3,600 images is to harvest what yoiu can, say 400 images. Once those are in your Target folder, copy the contents of your target folder to the source folder and rerun the harvester. That'll give you 800. Do that a couple more times and you'll be getting close BUT save the original 400 source images elsewhere, so that you can flush out the 3200 duplicated target images and restart with just 400 source, once you've proved the system.


    My 5,777 images take up 1.41GB on the hard drive.



    If you have problems with installation, please comment here rather than emailing me at my givenm address. Thanks.

  4. #4
    Platinum Lounger
    Join Date
    Feb 2001
    Location
    Yilgarn region of Toronto, Ontario
    Posts
    5,453
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Harvesting Images for Random Desktop Wallpaper

    ... and lest you think I spend all my time writing trivial code ... here is the source for my VB6 BackGround.exe, which resets the background colour at re-boot time, cortesy of the StartUp folder!

    <pre>Attribute VB_Name = "Backgrnd"
    Private Declare Function BlockInput Lib "user32" (ByVal fBlock As Long) As Long
    ' Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)

    Private Declare Function SetSysColors Lib "user32" _
    (ByVal nChanges As Long, _
    lpSysColor As Long, _
    lpColorValues As Long) As Long

    Const COLOR_BACKGROUND = 1

    Public Sub Main()
    Call doit
    'wait 2 seconds before unblocking it
    ' Sleep 1000
    End Sub

    Private Sub doit()

    Dim retValue As Long
    Dim keyID As Long
    Dim bytHH As Byte
    Dim bytNN As Byte
    Dim bytSS As Byte
    '
    bytHH = 180 + (Format(Now(), "hh")) ' Hours as two digits
    ' bytHH = "00" ' seconds as two digits"
    bytNN = 180 + (Format(Now(), "nn")) ' Minutes as two digits
    ' bytNN = "00" ' seconds as two digits"
    bytSS = 180 + (Format(Now(), "ss")) ' seconds as two digits
    ' bytSS = "00" ' seconds as two digits"
    '
    retValue = SetSysColors(1, COLOR_BACKGROUND, RGB(bytHH, bytNN, bytSS))
    ' retValue = SetSysColors(1, COLOR_BACKGROUND, RGB(bytSS, bytNN, bytHH))
    '

    End Sub
    </pre>


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •