I am now the happiest man. Finally, I figured this out. There is a restriction on file size. The code was alright, once I test with small .bmp files, it works.

The bad thing is that, with big images, it does not work, but the API call still returns successfully. But not much one can do, that's just how it works.

Guys, thanks for all the helps. By the way, jacques, the reason I didn't install your module, instead only copied a piece is that, the whole point is to figure out what was wrong, not just workaround ;-) I wanted to know why.

Update:

When I say small .bmp file, I actually meant the file size. It probably not only has something to do with the size (width, height) of the image, but also could be the color schema (certain types of bmp), resolution. Any way, when I test with those wallpaper images coming with windows, they all worked. and I noticed that their sizes are small. (This moment, I am on windows 98).


In reply to Re: set windows background picture by pg
in thread set windows background picture by pg

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.