⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 book_text19.htm

📁 深入编程内幕vc++ 非常适合处学者学习
💻 HTM
📖 第 1 页 / 共 5 页
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!-- saved from url=(0063)http://www1.ustc.edu.cn/personal/csli/insidec++/book_text19.htm -->
<HTML><HEAD><TITLE>Visual C++</TITLE>
<META http-equiv=Content-Type content="text/html; charset=gb2312">
<META content="MSHTML 6.00.2900.2995" name=GENERATOR>
<META content=FrontPage.Editor.Document name=ProgId><LINK 
href="book_text19.files/style.css" type=text/css rel=stylesheet></HEAD>
<BODY bgColor=#f7fbff leftMargin=0 topMargin=0>
<TABLE height="100%" cellSpacing=0 cellPadding=0 width="100%" border=0>
  <TBODY>
  <TR>
    <TD width="3%" background=book_text19.files/page_side.gif 
    height="100%"> </TD>
    <TD vAlign=top align=middle width="97%">
      <P 
      style="mso-line-height-alt: 1.3pt; tab-stops: right dotted 402.1pt"><SPAN 
      lang=EN-US 
      style="FONT-SIZE: 10.5pt; mso-bidi-font-size: 10.0pt"></O:P></SPAN></P>
      <TABLE height=23 width="99%" border=0>
        <TBODY>
        <TR>
          <TD width="2%" height=29></TD>
          <TD width="95%" height=29><PRE><B><FONT color=#000080><A name=_Toc419881661><SPAN style="mso-bookmark: _Toc419740479"><SPAN style="LAYOUT-GRID-MODE: line; FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">五 </SPAN><SPAN lang=EN-US style="LAYOUT-GRID-MODE: line">Visual C++</SPAN></SPAN></A><SPAN style="LAYOUT-GRID-MODE: line; FONT-FAMILY: 宋体; mso-bookmark: _Toc419740479; mso-ascii-font-family: Times New Roman; mso-hansi-font-family: Times New Roman">与多媒体</SPAN></FONT></B></PRE></TD>
          <TD width="3%" height=29></TD></TR>
        <TR>
          <TD width="2%" height=15></TD>
          <TD width="95%" height=15>
            <H2 style="mso-line-height-alt: 1.3pt"><A name=_Toc419881668><SPAN 
            lang=EN-US 
            style="FONT-SIZE: 18pt; LAYOUT-GRID-MODE: line; FONT-FAMILY: 宋体; mso-bidi-font-size: 10.0pt; mso-bookmark: _Toc419740486; mso-hansi-font-family: Arial">5 
            FLC动画</SPAN></A><SPAN lang=EN-US 
            style="FONT-SIZE: 18pt; LAYOUT-GRID-MODE: line; FONT-FAMILY: 宋体; mso-bidi-font-size: 10.0pt; mso-hansi-font-family: Arial"><O:P> 
            </O:P></SPAN></H2>
            <P class=MsoNormal 
            style="WORD-BREAK: break-all; TEXT-INDENT: 20pt; mso-line-height-alt: 1.3pt; mso-pagination: none; mso-layout-grid-align: none; punctuation-wrap: simple"><SPAN 
            lang=EN-US 
            style="FONT-SIZE: 10.5pt; LAYOUT-GRID-MODE: line; FONT-FAMILY: 宋体; mso-bidi-font-size: 10.0pt; mso-hansi-font-family: 'Times New Roman'">FLC</SPAN><SPAN 
            style="FONT-SIZE: 10.5pt; LAYOUT-GRID-MODE: line; FONT-FAMILY: 宋体; mso-bidi-font-size: 10.0pt; mso-hansi-font-family: 'MS Sans Serif'">和</SPAN><SPAN 
            lang=EN-US 
            style="FONT-SIZE: 10.5pt; LAYOUT-GRID-MODE: line; FONT-FAMILY: 宋体; mso-bidi-font-size: 10.0pt; mso-hansi-font-family: 'Times New Roman'">FLI动画同属于AutoDesk公司的产品,它们采用帧与帧之间求差及单帧RLE编码的方式,其特点是易于解码和编码。当然,它们没有为音频提供便利限制了它的应用范围。在FLC和FLI之间,FLI由于大小仅局限于320x200</SPAN><SPAN 
            style="FONT-SIZE: 10.5pt; LAYOUT-GRID-MODE: line; FONT-FAMILY: 宋体; mso-bidi-font-size: 10.0pt; mso-hansi-font-family: 'MS Sans Serif'">,调色板仅</SPAN><SPAN 
            lang=EN-US 
            style="FONT-SIZE: 10.5pt; LAYOUT-GRID-MODE: line; FONT-FAMILY: 宋体; mso-bidi-font-size: 10.0pt; mso-hansi-font-family: 'Times New Roman'">64</SPAN><SPAN 
            style="FONT-SIZE: 10.5pt; LAYOUT-GRID-MODE: line; FONT-FAMILY: 宋体; mso-bidi-font-size: 10.0pt; mso-hansi-font-family: 'MS Sans Serif'">色,最多</SPAN><SPAN 
            lang=EN-US 
            style="FONT-SIZE: 10.5pt; LAYOUT-GRID-MODE: line; FONT-FAMILY: 宋体; mso-bidi-font-size: 10.0pt; mso-hansi-font-family: 'Times New Roman'">4000</SPAN><SPAN 
            style="FONT-SIZE: 10.5pt; LAYOUT-GRID-MODE: line; FONT-FAMILY: 宋体; mso-bidi-font-size: 10.0pt; mso-hansi-font-family: 'MS Sans Serif'">帧长度,使它已差不多退出了历史舞台。因此,我们在此不再讲述<SPAN 
            lang=EN-US>FLI,只介绍FLC动画原理及实现方式。<O:P> </O:P></SPAN></SPAN></P>
            <P class=MsoNormal 
            style="WORD-BREAK: break-all; mso-line-height-alt: 1.3pt; mso-pagination: none; mso-layout-grid-align: none; punctuation-wrap: simple"><B 
            style="mso-bidi-font-weight: normal"><SPAN lang=EN-US 
            style="FONT-SIZE: 12pt; LAYOUT-GRID-MODE: line; FONT-FAMILY: 宋体; mso-bidi-font-size: 10.0pt; mso-hansi-font-family: 'MS Sans Serif'">FLC文件的结构<O:P> 
            </O:P></SPAN></B></P>
            <P class=MsoNormal 
            style="WORD-BREAK: break-all; mso-line-height-alt: 1.3pt; mso-pagination: none; mso-layout-grid-align: none; punctuation-wrap: simple"><SPAN 
            lang=EN-US 
            style="FONT-SIZE: 10.5pt; LAYOUT-GRID-MODE: line; FONT-FAMILY: 宋体; mso-bidi-font-size: 10.0pt; mso-hansi-font-family: 'MS Sans Serif'">FLC文件的结构图示如下:</SPAN><BR 
            style="mso-ignore: vglayout" clear=all><SPAN lang=EN-US 
            style="FONT-SIZE: 10.5pt; LAYOUT-GRID-MODE: line; FONT-FAMILY: 宋体; mso-bidi-font-size: 10.0pt; mso-hansi-font-family: MS Sans Serif">&nbsp;<O:P> 
            </O:P></SPAN><BR style="mso-ignore: vglayout" clear=all><SPAN 
            style="mso-ignore: vglayout"><IMG height=204 
            src="book_text19.files/book_t1.gif" width=195 
            v:shapes="_x0000_s1026"></SPAN></P>
            <P><BR style="mso-ignore: vglayout" clear=all><SPAN lang=EN-US 
            style="FONT-SIZE: 10.5pt; LAYOUT-GRID-MODE: line; FONT-FAMILY: 宋体; mso-bidi-font-size: 10.0pt; mso-hansi-font-family: MS Sans Serif">FLC文件头数据结构如下:</SPAN></P>
            <P><SPAN style="mso-ignore: vglayout"><IMG height=246 
            src="book_text19.files/book_t2.gif" width=330 
            v:shapes="_x0000_s1027"></SPAN></P><!--[if gte vml 1]></O:WRAPBLOCK><![endif]--><BR 
            style="mso-ignore: vglayout" clear=all><SPAN lang=EN-US 
            style="FONT-SIZE: 10.5pt; LAYOUT-GRID-MODE: line; FONT-FAMILY: 宋体; mso-bidi-font-size: 10.0pt; mso-hansi-font-family: MS Sans Serif">帧头数据结构:<O:P> 
            </O:P></SPAN>
            <P><SPAN style="mso-ignore: vglayout"><IMG height=106 
            src="book_text19.files/book_t3.gif" width=330 
            v:shapes="_x0000_s1028"></SPAN><SPAN lang=EN-US 
            style="FONT-SIZE: 10.5pt; LAYOUT-GRID-MODE: line; FONT-FAMILY: 宋体; mso-bidi-font-size: 10.0pt; mso-hansi-font-family: 'MS Sans Serif'; mso-bidi-font-family: 'Times New Roman'; mso-ansi-language: EN-US; mso-fareast-language: ZH-CN; mso-bidi-language: AR-SA"><BR 
            style="PAGE-BREAK-BEFORE: always" clear=all></SPAN></P>
            <P class=MsoNormal 
            style="WORD-BREAK: break-all; mso-line-height-alt: 1.3pt; mso-pagination: none; mso-layout-grid-align: none; punctuation-wrap: simple"><SPAN 
            style="FONT-SIZE: 10.5pt; LAYOUT-GRID-MODE: line; FONT-FAMILY: 宋体; mso-bidi-font-size: 10.0pt; mso-hansi-font-family: 'MS Sans Serif'">块头数据结构:</SPAN></P>
            <P class=MsoNormal 
            style="WORD-BREAK: break-all; mso-line-height-alt: 1.3pt; mso-pagination: none; mso-layout-grid-align: none; punctuation-wrap: simple"><IMG 
            height=105 src="book_text19.files/book_t4.jpg" width=391 
            border=0></P>
            <P class=MsoNormal 
            style="WORD-BREAK: break-all; mso-line-height-alt: 1.3pt; mso-pagination: none; mso-layout-grid-align: none; punctuation-wrap: simple"><BR 
            style="mso-ignore: vglayout" clear=all><SPAN 
            style="FONT-SIZE: 10.5pt; LAYOUT-GRID-MODE: line; FONT-FAMILY: 宋体; mso-bidi-font-size: 10.0pt; mso-hansi-font-family: 'MS Sans Serif'">块的类型及解释:</SPAN></P>
            <P><SPAN lang=EN-US 
            style="FONT-SIZE: 10.5pt; LAYOUT-GRID-MODE: line; FONT-FAMILY: 宋体; mso-bidi-font-size: 10.0pt; mso-hansi-font-family: MS Sans Serif"><O:P></O:P><IMG 
            height=165 src="book_text19.files/book_t5.jpg" width=345 
            border=0></SPAN></P>
            <P class=MsoNormal 
            style="WORD-BREAK: break-all; mso-line-height-alt: 1.3pt; mso-pagination: none; mso-layout-grid-align: none; punctuation-wrap: simple; mso-outline-level: 1"><B 
            style="mso-bidi-font-weight: normal"><SPAN lang=EN-US 
            style="FONT-SIZE: 12pt; LAYOUT-GRID-MODE: line; FONT-FAMILY: 宋体; mso-bidi-font-size: 10.0pt; mso-hansi-font-family: 'MS Sans Serif'">FLC动画播放源程序简介<O:P> 
            </O:P></SPAN></B></P>
            <P class=MsoNormal 
            style="WORD-BREAK: break-all; TEXT-INDENT: 1cm; mso-line-height-alt: 1.3pt; mso-pagination: none; mso-layout-grid-align: none; punctuation-wrap: simple"><SPAN 
            style="FONT-SIZE: 10.5pt; LAYOUT-GRID-MODE: line; FONT-FAMILY: 宋体; mso-bidi-font-size: 10.0pt; mso-hansi-font-family: 'MS Sans Serif'">我们分析一下<SPAN 
            lang=EN-US>FLC动画源程序:打开文件flcw.h,可以看见文件中定义了FLC文件头、帧头、块头及块类型的宏。另外我们可以发现类FLCW是从类MYDIB中派生来的,这是因为不管FLC动画本身如何复杂,只要是往屏幕上画图,最后都是要在内存中转换成位图形式。FLC动画实现过程中,在Open阶段就生成了一个大小与FLC动画相同的内存位图,以后每次读取下一帧,就把数据写入内存位图,再将内存位图贴到屏幕上。<O:P> 
            </O:P></SPAN></SPAN></P>
            <P class=MsoNormal 
            style="WORD-BREAK: break-all; mso-line-height-alt: 1.3pt; mso-pagination: none; mso-layout-grid-align: none; punctuation-wrap: simple"><SPAN 
            lang=EN-US 
            style="FONT-SIZE: 10.5pt; LAYOUT-GRID-MODE: line; FONT-FAMILY: 宋体; mso-bidi-font-size: 10.0pt; mso-hansi-font-family: 'Times New Roman'">&nbsp;<O:P> 
            </O:P></SPAN></P>
            <P class=MsoNormal 
            style="WORD-BREAK: break-all; mso-line-height-alt: 1.3pt; mso-pagination: none; mso-layout-grid-align: none; punctuation-wrap: simple"><SPAN 
            lang=EN-US 
            style="FONT-SIZE: 10.5pt; BACKGROUND: #d9d9d9; LAYOUT-GRID-MODE: line; FONT-FAMILY: 'Courier New'; mso-bidi-font-size: 10.0pt; mso-bidi-font-family: 'Times New Roman'; mso-shading: white; mso-pattern: gray-15 auto">// 
            FLCW.h: interface for the FLCW class.<O:P> </O:P></SPAN></P>
            <P class=MsoNormal 
            style="WORD-BREAK: break-all; mso-line-height-alt: 1.3pt; mso-pagination: none; mso-layout-grid-align: none; punctuation-wrap: simple"><SPAN 
            lang=EN-US 
            style="FONT-SIZE: 10.5pt; BACKGROUND: #d9d9d9; LAYOUT-GRID-MODE: line; FONT-FAMILY: 'Courier New'; mso-bidi-font-size: 10.0pt; mso-bidi-font-family: 'Times New Roman'; mso-shading: white; mso-pattern: gray-15 auto">//<O:P> 
            </O:P></SPAN></P>
            <P class=MsoNormal 
            style="WORD-BREAK: break-all; mso-line-height-alt: 1.3pt; mso-pagination: none; mso-layout-grid-align: none; punctuation-wrap: simple"><SPAN 
            lang=EN-US 
            style="FONT-SIZE: 10.5pt; BACKGROUND: #d9d9d9; LAYOUT-GRID-MODE: line; FONT-FAMILY: 'Courier New'; mso-bidi-font-size: 10.0pt; mso-bidi-font-family: 'Times New Roman'; mso-shading: white; mso-pattern: gray-15 auto">//////////////////////////////////////////////////////////////////////<O:P> 
            </O:P></SPAN></P>
            <P class=MsoNormal 
            style="WORD-BREAK: break-all; mso-line-height-alt: 1.3pt; mso-pagination: none; mso-layout-grid-align: none; punctuation-wrap: simple"><SPAN 
            lang=EN-US 
            style="FONT-SIZE: 10.5pt; BACKGROUND: #d9d9d9; LAYOUT-GRID-MODE: line; FONT-FAMILY: 'Courier New'; mso-bidi-font-size: 10.0pt; mso-bidi-font-family: 'Times New Roman'; mso-shading: white; mso-pattern: gray-15 auto">&nbsp;<O:P> 
            </O:P></SPAN></P>
            <P class=MsoNormal 
            style="WORD-BREAK: break-all; mso-line-height-alt: 1.3pt; mso-pagination: none; mso-layout-grid-align: none; punctuation-wrap: simple"><SPAN 
            lang=EN-US 
            style="FONT-SIZE: 10.5pt; BACKGROUND: #d9d9d9; LAYOUT-GRID-MODE: line; FONT-FAMILY: 'Courier New'; mso-bidi-font-size: 10.0pt; mso-bidi-font-family: 'Times New Roman'; mso-shading: white; mso-pattern: gray-15 auto">#if 
            !defined(AFX_FLCW_H__2A3B58A3_C964_11D1_94F8_0000B431BBA1__INCLUDED_)<O:P> 
            </O:P></SPAN></P>
            <P class=MsoNormal 
            style="WORD-BREAK: break-all; mso-line-height-alt: 1.3pt; mso-pagination: none; mso-layout-grid-align: none; punctuation-wrap: simple"><SPAN 
            lang=EN-US 
            style="FONT-SIZE: 10.5pt; BACKGROUND: #d9d9d9; LAYOUT-GRID-MODE: line; FONT-FAMILY: 'Courier New'; mso-bidi-font-size: 10.0pt; mso-bidi-font-family: 'Times New Roman'; mso-shading: white; mso-pattern: gray-15 auto">#define 
            AFX_FLCW_H__2A3B58A3_C964_11D1_94F8_0000B431BBA1__INCLUDED_<O:P> 
            </O:P></SPAN></P>
            <P class=MsoNormal 

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -