home *** CD-ROM | disk | FTP | other *** search
/ Programming Tool Box / SIMS_2.iso / vb_code1 / fade / readme.txt < prev   
Text File  |  1992-12-10  |  2KB  |  51 lines

  1. ==========================
  2.  FADE TO BLACK - Fade.Mak
  3. ==========================
  4.  
  5. This sample project demonstrates how to make the background of
  6. your form fade from blue to black.  It was designed to replicate 
  7. (as near as possible) the Setup forms used by Microsoft and
  8. most other major software publishers.  
  9.  
  10. The theory is simple - 
  11.  
  12.     1.  Divide the form into 63 regions
  13.  
  14.     2.  Create a SolidBrush that starts out as solid blue, 
  15.         i.e. RGB value of 0, 0, 255
  16.         (Create brush with API call CreateSolidBrush) 
  17.  
  18.     3.  Fill the first region of the form with the solid
  19.         blue brush (with API call FillRect)
  20.  
  21.     4.  Destroy the first brush (with API call DeleteOBject)
  22.         and create a second brush that has a little less blue 
  23.         (0, 0, 251)
  24.  
  25.     5.  Fill the second region of the form with the 
  26.         slightly less blue brush
  27.  
  28.     6.  Repeat steps 4 and 5 until form is filled.  The
  29.         last brush is pure black (0, 0, 0).
  30.  
  31. Although it sounds like it would take a long time to fill 63 regions
  32. with different brushes, it actually works very fast.
  33.  
  34. To add this to your own project, just add the file Fade.bas to your 
  35. project and put the following calls in your Form_Paint and Form_Resize
  36. events:
  37.  
  38.     FadeForm Me
  39.  
  40. NOTE:  I tried to do the same thing using VB's Line method, but it 
  41. insisted on drawing the outline of each box.  This looked very ugly.
  42.  
  43. SECOND NOTE:  The enclosed files were saved as text files under VB2.  
  44. Although they cannot be loaded directly into VB1, the primary file
  45. (Fade.bas) can be imported into a VB1 module or it can be viewed with
  46. Notepad or any other text editor.
  47.  
  48. Enjoy!
  49.  
  50. Brian Stine
  51. CS ID  73617,323