Click here to Skip to main content
Licence 
First Posted 16 Nov 2006
Views 31,235
Downloads 448
Bookmarked 13 times

Random Image Generator

By c010depunkk | 23 Jan 2007
A small app to generate random images using various C# drawing functions.
8 votes, 72.7%
1
1 vote, 9.1%
2

3
1 vote, 9.1%
4
1 vote, 9.1%
5
1.12/5 - 11 votes
2 removed
μ 1.31, σa 2.49 [?]

Introduction

This application uses various C# drawing functions to generate random images that can be used as wallpapers, etc..

Background

I started this program to teach myself the basic C# drawing functions. I kept getting more and more suggestions from friends and fans, and the project kept growing until I had quite a nice little program.

Points of Interest

The file_location parameter in:

const int SPI_SETDESKWALLPAPER = 20;
const int SPIF_UPDATEINIFILE = 0x01;
const int SPIF_SENDCHANGE = 0x2;
SystemParametersInfo(SPI_SETDESKWALLPAPER, 0, file_location, 
                     SPIF_UPDATEINIFILE | SPIF_SENDCHANGE);

can lead to very spectacular crashes. If it is empty when the user clicks on "apply" then the computer is completely off in approximately 0 seconds. Just comment out the if statement at the beginning of the apply-button click function and right after starting the app, without having generated an image click "apply" (but make sure you've saved everything before you do it). I'm not sure why this happens but it's definitely an interesting bug in the user_32.dll. Anyone have a clue why this happens?

The anti-aliasing feature is also interesting, the difference is very evident. I wanted to build it in permanently, but then decided to leave it as an option because some things look better without anti-aliasing (i.e., pixel blocks->all colors).

How to use the app

Not much I can say here. You just have to try things out till you get a good image. Because it is all random, if you generate enough times, you'll get a good result. Layering the images usually produces cool results, especially with a pixel block background. The small picture mosaic is also a lot of fun - GIF images with a transparent background look especially cool. Enjoy!

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here

About the Author

c010depunkk

Web Developer

Germany Germany

Member
I am an 18-year-old student currently studying software development in a small company in Willich, NRW, Germany. I grew up in America and (almost) graduated from Uniontown High School, Uniontown, PA.

Sign Up to vote   Poor Excellent
Add a reason or comment to your vote: x
Votes of 3 or less require a comment

Comments and Discussions

 
You must Sign In to use this message board. (secure sign-in)
 
Search this forum  
 FAQ
    Noise  Layout  Per page   
  Refresh
GeneralSo cool Pinmemberhasbeallah12:36 3 Oct '08  

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Mobile
Web02 | 2.5.120209.1 | Last Updated 23 Jan 2007
Article Copyright 2006 by c010depunkk
Everything else Copyright © CodeProject, 1999-2012
Terms of Use
Layout: fixed | fluid