home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Windows Gam…ming Gurus (2nd Edition) / Disc2.iso / msdn_vcb / samples / vc98 / sdk / com / activexcontrol / basectl / card / readme.txt < prev    next >
Text File  |  1997-10-04  |  4KB  |  105 lines

  1.  
  2. Playing Card Sample Control
  3. ===========================
  4. This sample ActiveX Control implements a standard playing card, with the
  5. ability to show the standard 52 card deck, two jokers, and 13 different
  6. card backs.  This control is a Windowless control, which uses transparency 
  7. to create the missing card corner effect.  
  8.  
  9. Building
  10. --------
  11. To build card.ocx, the FrameWrk sample must first be built. First run 
  12. \inetsdk\setenv.bat to be sure the ActiveX SDK include, bin, and lib
  13. directories are included (first) in your environment. Run the 'nmake'
  14. to build a debug version (built to the Debug subdirectory) or
  15. 'nmake nodebug=1' to build a retail (nodebug) directory into the
  16. Retail subdirectory.
  17.  
  18. After building the FrameWrk library you can build the Card
  19. control by running 'nmake' or 'nmake nodebug=1'.
  20.  
  21. Sample: ActiveX Video Poker
  22. ---------------------------
  23. Included is a sample application which uses card.ocx: ActiveX
  24. Video Poker.  To run this application, open poker\poker.htm.
  25. This application also depends on the ielabel control and 
  26. ietimer control.
  27.  
  28. To debug and work with this example, open poker\main.htm.  This
  29. file can be used outside of the framesets provided by poker.htm.
  30.  
  31. Sample: ActiveX Solitaire
  32. -------------------------
  33. Included is a sample application which uses card.ocx: ActiveX
  34. Solitaire.  To run this application, open solitair\sol.htm.
  35. This application also depends on the ietimer control and the
  36. HTML Layout Control.
  37.  
  38. Using the Card Control
  39. ----------------------
  40. The Card control is itself controlled through 3 properties:
  41.  
  42.     Suite        -- Enum:  0 = Invisible (card not drawn)
  43.                   1 = Clubs
  44.                   2 = Spades
  45.                   3 = Hearts
  46.                   4 = Diamonds
  47.                   -1 to -13 = Card Backs
  48.  
  49.     Number        -- Enum:  1 = Ace
  50.                   2 to 10 = Number Cards
  51.                   11 = Jack
  52.                   12 = Queen
  53.                   13 = King
  54.                   14 = Joker
  55.  
  56.     Invert        -- Boolean: controls drawing the card inverted,
  57.                       to indicate selection
  58.  
  59.     CardAlignment   -- Enum:  0 = Top Left
  60.                   1 = Top Center
  61.                   2 = Top Right
  62.                   3 = Center Left
  63.                   4 = Center
  64.                   5 = Center Right
  65.                   6 = Bottom Left
  66.                   7 = Bottom Center
  67.                   8 = Bottom Right
  68.                   9 = Stretch
  69.  
  70. By default the card starts in the transparent state.  Setting the 
  71. Suite to any value other than zero will draw the card.
  72.  
  73. A property page is also included with the control, which can simply 
  74. picking the right property values.
  75.  
  76. The card control will also fire the following events:
  77.  
  78.     Click        -- Mouse Click
  79.     DblClick    -- Mouse Double Click
  80.     MouseDown    -- Mouse down
  81.     MouseUp        -- Mouse up
  82.     MouseMove    -- Mouse move
  83.  
  84. How it Works
  85. ------------
  86. To keep the size of the control to a minimum, to minimize internet download
  87. time, each card is created from the ground up.  The only resources included
  88. in the control are the basic symbols needed to create the cards, one half
  89. of each face cards center, and the card backs.  Where possible, monochrome
  90. and compressed bitmaps are used.
  91.  
  92. The card control caches all card images after they have been created the
  93. first time.  For games such as Solitaire in which the cards move
  94. across one another, and most of the cards in a deck are displayed on the 
  95. screen at the same time, caching all the cards of course yields the best 
  96. animations.  To keep memory usage low, 4-bit DIB bitmaps are used to
  97. store the cached images.
  98.  
  99. This control is a Windowless control, which uses transparency to create the 
  100. missing card corner effect.  When used with Internet Explorer, the control
  101. is Windowed, and the ambient background color is used to fill in the corners.
  102. When used in the HTML Layout Control, or another Windowless control host,
  103. the corners are transparent and the card or background beneath can be seen.
  104.  
  105.