Reprinted please indicate the source, original address: http://blog.csdn.net/morewindows/article/details/8696724
Welcome to Weibo: http://weibo.com/MoreWindows
For Windows interface programming, the bitmap display special effect series directory is as follows:
1. The ninth part of Windows Interface Programming: bitmap display effect staggered
Http://blog.csdn.net/morewindows/article/details/8696720
2. Windows Interface Programming Article 10 bitmap display special effect blinds
Http://blog.csdn.net/morewindows/article/details/8696722
3. Windows Interface Programming 11th special bitmap display random block effects
Http://blog.csdn.net/morewindows/article/details/8696724
4. Windows Interface Programming 12th bitmap display special effects fly into effect and stretch Effect
Http://blog.csdn.net/morewindows/article/details/8696726
5. Windows Interface Programming 13th bitmap display special effects collection
Http://blog.csdn.net/morewindows/article/details/8696730
This article "Windows Interface Programming 11th bitmap display special effects random building block effect" will explain the bitmap random building block display effect. As shown in
(Images cannot be opened, please visit the http://blog.csdn.net/morewindows/article/details/8696724 ):
In programming, the random building block effect is the simplest, as long as a grid shows the entire location:
// Random blocks // The Windows Interface Programming 11th bitmap display special effects random blocks effect // http://blog.csdn.net/morewindows/article/details/8696724void animatedraw_randomblocks (HDC, HDC hdcmem, int nwidth, int nheight, uint nintervaltime = 15, int nrowblocks = 10, int ncolblocks = 10) {int blocks, nstepcol, ndisplaycount; int blocks = nrowblocks * ncolblocks; bool * pflagarray = new bool [nsumblocks]; memset (pflagarray, 0, sizeof (bool) * nsumblocks); nsteprow = nwidth/nrowblocks; nstepcol = nheight/ncolblocks; srand (unsigned) Time (null )); ndisplaycount = 0; // Number of displayed squares while (true) {int ROW = rand () % nrowblocks; int Col = rand () % ncolblocks; if (pflagarray [row * ncolblocks + Col]) continue; pflagarray [row * ncolblocks + Col] = true; bitblt (HDC, row * nsteprow, Col * nstepcol, nsteprow, nstepcol, hdcmem, row * nsteprow, Col * nstepcol, srccopy); ndisplaycount ++; If (ndisplaycount> = nsumblocks) break; sleep (nintervaltime);} bitblt (HDC, 0, 0, nwidth, nheight, hdcmem, 0, 0, srccopy );}
Complete program in "Windows Interface Programming 13th bitmap display special effect Collection"
Http://blog.csdn.net/morewindows/article/details/8696730
The next article "Windows Interface Programming 12th" displays the flying effect and stretching Effect of bitmap display "will explain the flying effect and stretching Effect of Bitmap.
Address: http://blog.csdn.net/morewindows/article/details/8696726
Reprinted please indicate the source, original address: http://blog.csdn.net/morewindows/article/details/8696724
Welcome to Weibo: http://weibo.com/MoreWindows