Windows Interface Programming 11th bitmap display special effects random building blocks

Source: Internet
Author: User

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.