HttpWebResponse webresponse = (HttpWebResponse)webrequest.GetResponse() WriteStream.Write(bytes, 0, bytes.Length) Using (Stream writeStream = webrequest.GetRequestStream())īyte bytes = (_Request) Webrequest.ContentLength = _Request.Length String _Request = BuildRequestBody(Items) Webrequest.ContentType = " application/x-www-form-urlencoded" HttpWebRequest webrequest = (HttpWebRequest)WebRequest.Create(Uri) / /// Site URL send the httprequest /// NameValueCollection with the data to send as post /// Image Url static string getImageUrl( string Uri, NameValueCollection Items) / /// Gets the image URL with an HTTPRequest I can change the image URL whenever I want or echo an empty string to avoid a change on the wallpaper.įor instance, hosted page would look as follows: To achieve this behavior, I’ll be hosting a web page with the URL of the desired image. However, since this is a prank, not only do I want to fully control the image that will be displaying but also when it will be displaying. ![]() We can provide a URL or a set of URLs to the image(s) we want to display. We can either provide the path to an image we already have stored. Getting the Image to DisplayĪs a first step, we need to choose the image we want to display as new wallpaper. ![]() But mainly, I’ll be using the method described by Sean Campbell in his article Setting Wallpaper (link to the article provided below). Next, I’ll be discussing different approaches to achieve the automation and periodical repetition of changing the computer’s wallpaper.įor the section about setting the wallpaper, I’ll be using documentation from other sites (which you can find at the end of this article, in the reference section). In this article, I’ll be using C# and calling Win32 APIs to change the computer’s wallpaper. There are quite a few articles around the web about changing a computer’s wallpaper describing the steps and providing sample code to achieve it. But, what if we could automate the process of changing someone else’s wallpaper? Furthermore, what if we could have a background process making the change whenever we want. When the owner of the computer comes back, he knows that he forgot to lock the computer and also has a good time laughing about the prank. If someone forgets to lock his/her computer, as part of the policy we have agreed, the remaining coworkers can make changes to the computer’s settings (typically changing the desktop wallpaper). Some may see a mythical octopus, for others it could be an alien bacteria.In our office, we have established the policy to lock our computer (Windows key + L) when we are away from it. The cube is slowly distorted like time and space in some science fiction movies. There is a retro game aspect on this demo created with only lines along a cube. Those lines are slowly moving from the bottom of the shape to its top. This demo is based on the previous one but instead of a solid shape, it is made with lines along its surface. You can control the power of that effect by moving your mouse from the top to the bottom of the screen. The morphing of this demo is controlled using a Perlin noise algorithm to generate a wobble effect. The animation is the same for all the dots but with a small delay to create the effect of elasticity. This demo is only made with dots slowly morphing from a sphere to a line. Those dots are randomly connected through lines and some of them are slowly moving to create an illusion of a real time data set. The dots in this demo react to the moving mouse with some bounce animations. Let’s have a look at the individual demos: ![]() Note that it’s always wise to add a fallback image in your project. You may want to create lighter versions for mobile devices. Attention: Please be aware that this is very experimental and some demos require a fast machine.
0 Comments
Leave a Reply. |