数字雨特效源代码,编译通过(Digital rain special effects source code, compiled by)_第1页
数字雨特效源代码,编译通过(Digital rain special effects source code, compiled by)_第2页
数字雨特效源代码,编译通过(Digital rain special effects source code, compiled by)_第3页
数字雨特效源代码,编译通过(Digital rain special effects source code, compiled by)_第4页
数字雨特效源代码,编译通过(Digital rain special effects source code, compiled by)_第5页
已阅读5页,还剩9页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

1、数字雨特效源代码,编译通过(Digital rain special effects source code, compiled by)#包括 istrlen = rand() %(strmaxlen-strminlen)+ strminlen;/ /显示列的长度Cc-x = x+3; / / display column started showing x coordinatesCc-y (=rand)%3? Rand (%cyScreen:0); / / display column started showing y coordinatesCc-iMustStopTimes = rand

2、 ()%6;Cc-iStopTimes = 0;Cc-head = cc-current =(pCharChain) calloc (cc-iStrLen, sizeof (CharChain); / / generation display columnFor (j=0; jiStrLen-1; j+)Cc-current-prev = cc-point; /cc-point, which displays the first element of the columnCc-current-ch =0;Cc-current-next = cc-current+1; /cc-current+1

3、; a post element that displays columnsCc-point = cc-current+; /cc-point = cc-current; cc-current+;Cc-current-prev = cc-point; / / the last nodeCc-current-ch =0;Cc-current-next = cc-head;Cc-head-prev = cc-current; / / the last element of a head node before this chainCc-current = cc-point = cc-head; /

4、free drops the memory to use current when the parameterCc-head-ch = (randomChar); / / the header element fill chainReturn 0;LRESULT, CALLBACK, WndProc (HWND, hWnd, UINT, message, WPARAM, wParam, LPARAM, lParam)HDC hdc;/ctn is used to determine whether a display chain is down, and if the wait times e

5、xceed the number of times that must wait, the CTN represents the move forwardInt, I, J, temp, CTN; /j is the Y coordinate displayed on the screen in a display chain except the chain header; temp green is over blackStatic HDC hdcMem;HFONT hFont;Static HBITMAP hBitmap;Static int cxScreen, cyScreen; /

6、/ screen width and height.Static int iFontWidth=10, iFontHeight=15, iColumnCount; / / font width and height, the number of columnsStatic CharColumn *ccChain;Switch (message)Case WM_CREATE:CxScreen = GetSystemMetrics (SM_CXSCREEN); / / screen widthCyScreen = GetSystemMetrics (SM_CYSCREEN);SetTimer (h

7、Wnd, ID_TIMER, 10, NULL);HDC = GetDC (hWnd);HdcMem = CreateCompatibleDC (HDC);hbitmap = createcompatiblebitmap (hdc, cxscreen, cyscreen);selectobject (hdcmem, hbitmap);releasedc (hwnd, hdc);/ / 创建字体hfont = createfont (ifontheight, ifontwidth - 5, 0, 0, fw _ bold, 0, 0, 0default _ charset, out _ defa

8、ult _ precis, clip _ default _ precis.draft _ quality, fixed _ pitch | ff _ swiss, text (fixedsys);selectobject (hdcmem, hfont);deleteobject (hfont);setbkmode (hdcmem, transparent); / / 设置背景模式为 透明icolumncount = cxscreen / (ifontwidth * 3 / 2); / / 屏幕所显示字母雨的列数ccchain = (pcharcolumn) calloc (icolumnco

9、unt, sizeof (charcolumn);for (i = 0; i icolumncount; i + +)init (ccchain + i, cyscreen (ifontwidth * 3 / 2) * i);return 0;case wm _ timer.hdc = getdc (hwnd);PatBlt(hdcmem,0, 0,cxscreen,cyscreen,黑度);/ /将内存设备映像刷成黑色为(i = 0;i istoptimes + (ccchain +我)- imuststoptimes;/ /(ccchain +我)-点=(ccchain +我)-头;/ /

10、点用于遍历整个显示列/ /第一个字符显示为白色SetTextColor(hdcmem,RGB(255, 255, 255);TextOut(hdcmem,(ccchain +我)- X,(ccchain +我)- Y,&(ccchain +我)-点- CH),1);J =(ccchain +我)- Y;(ccchain +我)-点=(ccchain +我)-点下;/ /遍历整个显示列,将这个显示列里的字符从下往上显示温度= 0;/温度绿色过度到黑色之用而(ccchain +我)-点!=(ccchain +我)-头&(ccchain +我)-点- CH)SetTextColor(hdcmem,R

11、GB(0, 255 -(255(温度+ +)/(ccchain +我)- istrlen),0);TextOut(hdcmem,(ccchain +我)- X,J = ifontheight,&(ccchain +我)-点- CH),1);(ccchain +我)-点=(ccchain +我)-点下;如果(CTN)(ccchain +我)- istoptimes = 0;继续;(ccchain +我)- y + = ifontheight;/ /下次开始显示的Y坐标为当前的Y坐标加上一个字符的高度/ /如果开始显示的Y坐标减去整个显示列的长度超过了屏幕的高度如果(ccchain +我)- Y(

12、ccchain +我)- istrlen * ifontheight cyscreen)免费(ccchain +我)-电流);init(ccchain +我,cyscreen,(ifontwidth * 3 / 2)*我);/ /链表的头为此链表的前个元素,因为下次开始显示的时候就相当与在整个显示列的开头添加个元素,然后在开始往上显示(ccchain +我)-头=(ccchain +我)-头-沪指;(ccchain +我)-头- CH = randomchar();bitblt (hdc, 0, 0, cxscreen, cyscreen, hdcmem, 0, 0, srccopy);releasedc (hwnd, hdc);return 0;case wm _ rbuttondown:killtimer (hwnd, id _ timer);return 0;case wm _ rbuttonup:settimer (hwnd, id _ timer, 10, null);return 0;/ / 处理善后工作case wm _ keydown:case wm _ lbuttondown:case _ w

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论