|
|
1.1 root 1: Sample: Demonstrating GDI and USER API Functions in Fractals
2:
3: Summary:
4:
5: The MANDEL sample demonstrates the Win32 GDI and USER API
6: functions in the setting of fractals.
7:
8: More Information:
9:
10: The Mandelbrot Dream provides the following functions:
11:
12: Drawing the Mandelbrot set and the corresponding julia
13: set
14: Zooming into any of the set
15: MDI fractal drawing windows
16: Floating Point Math/Fix Point Math
17: Shifting color table entries
18: Changing palette entries and animating palatte aka color
19: cycling
20: Loading/Saving bitmap created with special effect
21: Changing bitmap color with flood fill
22: Boundary tracing and creating a clip region out of it for
23: creating special effect
24: Enumerate printers for printing
1.1.1.2 ! root 25: Load RLE (or convert .bmp files to RLE) for playing in viewer
! 26: Save the RLE in memory to disk.
! 27:
! 28:
! 29: Note: The sample also makes use of the LARGE_INTEGER library
! 30: shipped with the SDK for its fixed point math.
1.1 root 31:
32:
33: Drawing the Mandelbrot Set and the Corresponding Julia Set
34:
35: 1.To draw the Mandelbrot set, choose the Mandelbrot Set
36: menu item from the Create menu to create a MDI child
37: window to draw the set in if one has not already been
38: created.
39:
40: 2.Then, choose either "use Fix Point math" or "use Floating
41: Point math" from the Draw menu to decide if floating
42: point or fixed point math is desired for calculation.
43: Fix Point is faster, however you lose resolution sooner
44: as you zoom in.
45:
46: 3.Also, choose the number of iterations from the Iteration
47: menu item and choose Step from the Draw menu. The higher
48: the number of iterations, the more detail is the picture
49: but the slower to generate the picture. The step
50: determines whether every scan line is drawn. The more
51: scan lines it has, the better the picture but the slower
52: to generate the picture.
53:
54: 4.To start drawing, choose Draw Set from the Draw menu.
55:
56: 5.To draw the Julia set, use the right mouse button to
57: select a point in the Mandelbrot set (the drawing surface
58: of the Mandlebrot window). A new Julia MDI window will be
59: created. Then choose Draw Set from the Draw menu to
60: start drawing.
61:
62: 6.The point selected with the right mouse button determines
63: the complex constant to use for the Julia Set.
64:
65: Zooming Into Any of the Set
66:
67: 1.To zoom in, click, drag and release with the left mouse
68: button to describe the zoom in region.
69:
70: A new MDI child of the same type as the parent
71: (Mandelbrot window or Julia window) will be created.
72:
73: 2.Choose Draw Set from the Draw menu to start drawing.
74:
75: MDI Fractal Drawing Windows
76:
77: Choose either Mandelbrot Set or Julia Set from the Create
78: menu for creating a new MDI window for drawing.
79:
80: Or, use the left mouse button to describe a zoom in
81: region in either a mandelbrot or Julia MDI window for
82: creating a new MDI window for drawing.
83:
84: Or, click on the Mandelbrot window with the right mouse
85: button for creating a Julia MDI window corresponding to
86: the mouse click position in the Mandelbrot window.
87:
88: Floating Point Math/Fix Point Math
89:
90: Choose the appropriate menu item ("Floating Point math"
91: or "Fix Point math") from the Draw menu. The Fix Point
92: math uses 20.11 fixed point integer arithmetic for
93: calculation.
94:
95: Shifting Color Table Entries
96:
97: Choose Shift from the Color menu or hit F10 to shift the
98: color table entry. The picture of the active MDI window
99: will be updated.
100:
101: Changing Palette Entries and Animating Palatte (aka Color
102: Cycling)
103:
104: Choose Cycle from the Color menu or hit F11 to start
105: color cycling the picture.
106:
107: The menu item will be grayed if the display device does
108: not support palette management. Currently, only the MIPs
109: display driver supports that.
110:
111: Loading/Saving Bitmaps Created With Special Effect
112:
113: Choose Load Bitmap from the Bitmap menu to load a bitmap
114: into the active child window. Or, choose Save Bitmap As
115: to save the picture in the active MDI child window.
116:
117: Changing Bitmap Color With Floodfill
118:
119: Choose Custom from the Color menu to select a color.
120: Then the cursor will be changed to a paint can over the
121: active child window. Click with the left mouse button on
122: the picture, the old color under the cursor will be
123: changed to the new color.
124:
125: Boundary Tracing and Creating a Clip Region Out of it For
126: Creating Special Effect
127:
128: From any active Mandelbrot window, choose Set Mandelbrot
129: Clip region from the Region menu. The boundary of the
130: escape region will be traced. The region will then be
131: selected as a clip region.
132:
133: Thus, if you load a bitmap for display, the bitmap will
134: only show through the clip region. The new picture can
135: then be saved.
136:
137: To remove the clip region, choose Remove Clip Region from
138: the Region menu.
139:
140: Note, the boundary tracing algorithm may trace out a
141: small island of only several pixels and stop. If that
142: happens, you might change the size of the window or
143: create another zoom window and trace again.
144:
145: Enumerate printers for printing
146:
147: On start up, the Mandelbrot Dream will enumerate the
148: printers and insert the printers into the Print menu.
149: Then selecting the printer on the Print menu will print
150: the picture in the active MDI window.
151:
1.1.1.2 ! root 152: Load RLE (or convert .bmp files to RLE) for playing in viewer
1.1 root 153:
1.1.1.2 ! root 154: Choose the Viewer item from the Create menu to create a
! 155: viewer window or bring any existing viewer window to the top.
! 156: Select Load Bitmap(s) from the File menu for loading RLE or
! 157: bmp files into the memory from disk.
! 158: Select the Play or Play Continuously item from the Options
! 159: menu for viewing.
! 160:
! 161: For demonstration of what this functionality can do.
! 162: Load the .\rsc\julia.rle file and select Play Continuously.
! 163: The Julia.rle is a collections of the various julia sets
! 164: along the boundary of escaping and non-escaping points of
! 165: the Mandelbrot Set.
! 166:
! 167: Save the RLE in memory to disk.
! 168:
! 169: Choose the Viewer item from the Create menu to create a
! 170: viewer window or bring any existing viewer window to the top.
! 171: Select Save Bitmap(s) from the File menu for saving the RLE(s)
! 172: from memory to disk.
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.