Click here to Skip to main content
Licence 
First Posted 14 Dec 2003
Views 101,954
Bookmarked 61 times

CCloudsCtrl - Simulating clouds using MFC

By | 14 Dec 2003 | Article
This control simulates clouds with scrolling text and can be used as an aboutbox.
Prize winner in Competition "MFC/C++ Nov 2003"

Sample Image - CCloudsCtrl.jpg

Introduction

This class simulates clouds by using plasmas and a few 'simple' pixel operations.

3 layers of plasmas are blended together to build an image that looks like pretty realistic clouds (on a not so cloudy day...). There's also an option to enhance the clouds with an exponential function, to create an even more realistic looking sky. You can learn the complete theory by reading the excellent tutorial here. Unfortunately, this great article only gives us pseudo code, so we have to do the rest ourselves... The plasma implementation is partially based on code by Andrea Griffini (found on the Internet).

Usage

To use the class in your application, you need to do the following:

  1. Insert the .h and .cpp files into your project.
  2. Add a static control into your dialog resource.
  3. Add a member variable for that static control.
  4. Modify the variable declaration.

Change this:

CStatic m_CloudsCtrl;

To this:

CCloudsCtrl m_CloudsCtrl;

In your dialog's constructor, set text for the credits:

CString strCredits = "\tCCloudsCtrl Example\n\n"
      "\rProgrammed by:\n"
      "Pablo van der Meer\n\n\n"
      "\rSpecial thanks to:\nhttp://www.codeproject.com/\n\n\n"
      "Copyright © 2003 Pablo Software Solutions\n"
      "All right reserved.\n\n\n"
      "\rhttp:\\www.pablovandermeer.nl\n\n";

m_CloudsCtrl.SetCredits(strCredits);

Contacting the Author

Please send any comments or bug reports to me via email. For updates to this article (and many other articles), check my site.

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

Pablo van der Meer

Web Developer

Netherlands Netherlands

Member



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
QuestionHow to increase the size of display string (strCredits) Pinmemberapurv1463:09 18 Aug '09  
QuestionHow do i control the coordinates of the clouds? PinmemberJ. Myers6:08 15 Feb '07  
GeneralMemory Error PinmemberFad B4:34 13 May '06  
GeneralAmazing Stuff!!!! Pinmemberrajeev824:29 10 Jan '06  
GeneralRe: Amazing Stuff!!!! PinmemberPortatofe8:41 2 Oct '08  
QuestionResizing the control ? Pinsusssl0011:27 20 May '04  
Questionanything for 3d? PinmemberJoaquin Grech (Creative1)10:34 25 Dec '03  
AnswerRe: anything for 3d? PinmemberPablo van der Meer10:55 25 Dec '03  
GeneralRe: anything for 3d? PinmemberJoaquin Grech (Creative1)12:00 25 Dec '03  
QuestionNice, how can I change colors? Pinmembernaveed7:00 22 Dec '03  
AnswerRe: Nice, how can I change colors? PinmemberPablo van der Meer8:04 22 Dec '03  
GeneralGreat work Pinmemberbfadi1:47 19 Dec '03  
Generalnice. Pinmemberbeavis22:38 15 Dec '03  
GeneralCool!!! PinmemberLuis Alonso Ramos7:58 15 Dec '03  
GeneralRe: Cool!!! PinsitebuilderUwe Keim1:15 18 Dec '03  
GeneralGood - but room for improvment PinmemberJoel Holdsworth5:47 15 Dec '03  
GeneralRe: Good - but room for improvment PinmemberPablo van der Meer6:41 15 Dec '03  
GeneralRe: Good - but room for improvment PinmemberBalkrishna Talele0:09 16 Dec '03  
GeneralRe: Good - but room for improvment PinmemberJoel Holdsworth0:11 16 Dec '03  

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
Web04 | 2.5.120517.1 | Last Updated 15 Dec 2003
Article Copyright 2003 by Pablo van der Meer
Everything else Copyright © CodeProject, 1999-2012
Terms of Use
Layout: fixed | fluid