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

📄 01_9_17_40.asp.html

📁 有用的VC教程,包括编程思想编程技巧程序效率等方面的指导
💻 HTML
📖 第 1 页 / 共 2 页
字号:
<html><head><meta http-equiv='Content-Type' content='text/html; charset=gb2312'>
<TITLE>计算机世界网-5.3 多媒体图形图像技术</TITLE></HEAD>
<style>
.a14{font-size:14px;text-indent:25px;line-height:20px}
.f{font-size:18px;color=#0f3ccd}
img{border:0px;}
td,p,input{font-fammily:verdana,宋体;font-size:12px;}
A:link {text-decoration:none;color:black}
A:visited {text-decoration:none;color:#80006f}
A:hover {text-decoration:underline;color:black}
</style>
<center>
<BODY topmargin=2 leftmargin=0>
<style>
.v12{font-size:10pt;color:"#ffffff";FONT-WEIGHT: bold}
.v14{font-size:14px;text-indent:25px;line-height:20px}
img{border:0px;}
td,p,input,select{font-fammily:verdana,宋体;font-size:12px;}
A:link {text-decoration:none;color:black}
A:visited {text-decoration:none;color:#80006f}
A:hover {text-decoration:underline;color:black}
</style>

<style>
.v13{font-size:10pt;color:"#ffffff";FONT-WEIGHT: bold}
.v12{font-size:13px;color:"#4C029C";FONT-WEIGHT: bold}
.v14{font-size:14px;text-indent:25px;line-height:20px}
img{border:0px;}
td,p,input,select{font-fammily:verdana,宋体;font-size:12px;}
A:link {text-decoration:none;color:black}
A:visited {text-decoration:none;color:#80006f}
A:hover {text-decoration:underline;color:black}
</style>

<!--头-->

<table align=center cellpadding="0" cellspacing="0" border="0" width="767">
  <tr><td valign=bottom>
      <table cellpadding="0" cellspacing="0" border=0>
        <tr><td valign=top><img src="../../../../../center/image/ccwlogo.gif"></td></tr>
        <tr><td height="27" valign=top><img src="../../../../../center/image/knowledge.gif" width="207" height="27"></td></tr>
      </table></td>
	<td valign=bottom width=556 bgcolor="#4c029c" height=96>
		  <table cellpadding="0" cellspacing="0" border=0 width=556 bgcolor="#4c029c" height=96>
        <tr><td height=25 valign=bottom bgcolor="#ffffff"  colspan=2 ><img src="../../../../../image2002/top.gif" usemap="#F"></td></tr>
	<tr  valign=middle >
		<td align=center valign=middle height="60" align=center>
		<!-- <a href="http://www.ccw.com.cn/search/" target=_blank><img src="../../../../../img2/esearch.GIF" border=0 width=468 height=60></a> --><a href="http://www.ccw.com.cn/html/search/thememail/" target=_blank><img src="../../../../../img2/topbanner_thememail.GIF" border=0 width=468 height=60></a>	
		</td>		
		<td  align=center width=15%>
			<table width=95%>
				<tr><td><a href="mailto:center@ccw.com.cn?subject=我要投稿:" target=_blank><font class=v13>我要投稿</a><br><a href="mailto:center@ccw.com.cn?subject=编读往来"><font class=v13>编读往来</a><br><a href="javascript:AddBookMark('计算机世界网首页')"><font class=v13>加入收藏</a></font></td></tr>
			</table>
		</td>
	</tr>
		<tr><td bgcolor="#ffffff" height=1 colspan=2 ></td></tr>
		<tr><td bgcolor="#b4aafc" height=2 colspan=2 ></td></tr></table>
		<map name="F">
<area href="http://www.ccw.com.cn/" shape="rect" coords="29, 3, 61, 18" target=_blank>
<area href="http://www.ccw.com.cn/news1/" shape="rect" coords="72, 3, 143, 18" target=_blank>
<area href="http://www.ccw.com.cn/center/" shape="rect" coords="155, 2, 216, 18" target=_blank>
<area href="http://www.ccw.com.cn/work/" shape="rect" coords="225, 2, 299, 18" target=_blank>
<area href="http://www.ccw.com.cn/search/" shape="rect" coords="310, 3, 364, 19" target=_blank>
<area href="http://www3.ccw.com.cn/" shape="rect" coords="372, 2, 412, 19" target=_blank>
<area href="http://www2.ccw.com.cn/" shape="rect" coords="424, 2, 550, 18" target=_blank></map>
	</td></tr>
	<tr><td colspan=2 bgcolor="#b4aafc">
	<table border=0 cellpadding=0 cellspacing=0 width=100%>
		<tr>
            <td width=26% align=center><font  class=v12>【2003年6月24日】&nbsp;&nbsp;&nbsp;</font></td>
            <td CLASS=V12> <a href="http://www.ccw.com.cn/center/topic.asp">专 题</a> /</td>
            <td CLASS=V12><a href="http://www.ccw.com.cn/center/tech.asp">技 术</a>  /</td>
            <td CLASS=V12><a href="http://www.ccw.com.cn/center/prod.asp">产 品</a> /</td>
            <td CLASS=V12><a href="http://www.ccw.com.cn/center/app.asp">应 用</a> /</td>
            <td CLASS=V12><a href="http://www.ccw.com.cn/center/net.asp">网 络</a> /</td>
            <td CLASS=V12><a href="http://www.ccw.com.cn/center/prog.asp">编 程</a> /</td>
            <td CLASS=V12><a href="http://www.ccw.com.cn/center/skill.asp">技 巧</a> </td>
         </tr>
	</table>
	</td></tr>
</table>
<table align=center width=728>
<tr><td align=center><br><h2><font color='#0f3ccd'>5.3 多媒体图形图像技术</font></h2>
</td></tr><tr><td align=right>01-9-17 下午 02:11:07<br><hr size=1 width=718 color=#f46240></td></tr></table><br>
<table align=center width=728><tr><td valign=top width=600>
<table width=100% ><tr><td class=a14>现在我们讲述windows多媒体中最重要,最核心的技术──图形技术。对于Windows的图形图像技术来说,包括基本的GDI绘制对像如点、线、矩形、图像和位图文件,引而广之所有的动画文件都要利用到windows图像图形技术编程。</td></tr></table><table width=100% ><tr><td class=a14>
本章节我们主要讲述Bmp文件实现过程、调色板应用,及一些Bmp图像合成技术,例如:透空技术、Bmp动画技术等。</td></tr></table>
  <table width=100% >
    <tr> 
      <td class=a14><font color="#CC0000"> Bmp文件结构</font></td>
    </tr>
  </table>
  <table width=100% >
    <tr>
      <td class=a14> Bmp文件由以下几个部分组成:文件头、位图信息头、调色板、数据区。下面这张图显示了Bmp文件结构:</td>
    </tr>
    <tr>
      <td class=a14>
        <div align="center"><img src="01_9_17_52.GIF" width="168" height="76"></div>
      </td>
    </tr>
  </table>
  <table width=100% >
    <tr> 
      <td class=a14><font color="#CC0000"> Windows位图显示的必要条件:</font></td>
    </tr>
  </table>
  <table width=100% ><tr><td class=a14>
我们分析一下一个Windows API函数:</td></tr></table><table width=100% ><tr>
      <td class=a14> int SetDIBitsToDevice(hdc,uXDest,uYDest,uWidth,uHeight,uXSrc,uYSre,uStartScan,cScanLines,lpvBits,lpbmi,fuColorUse)</td>
    </tr></table>
  <table width=100% ><tr><td class=a14>
请查看这个函数的第十、十一个参数lpvBits,lpbmi。其中lpvBits指明了指向内存中BMP数据的地址,lpbmi指向一个BITMAPINFO的数据结构,只要有了这两个参数,一个BMP位图就被确定了。大家可以看到绝大多数的Windows图形图像浏览软件所能分析的文件格式,例如jpg、gif、pcx、tif等等,都是先在内存中建一个数据缓冲区,再根据图形图像格式建立一个BITMAPINFO的数据结构,再利用SetDIBitsToDevice函数写到屏幕上。我们下面几个实例,也基本上采用这个方式。</td></tr></table>
  <table width=100% >
    <tr> 
      <td class=a14><font color="#CC0000"> Windows的调色板</font></td>
    </tr>
  </table>
  <table width=100% ><tr><td class=a14>
Windows的显示设备可以显示出成千上万种颜色,但是,在同一个屏幕上能同时显示的颜色数并不是成千上万种,我们把显示设备分为单色、十六色、二百五十六色、增强色、真彩色,或者是按照显示位区分成1bit,4bit,8bit,16bit,24bit。由于Windows的理论显示数和实际显示数并不相符,因此需要一个方案来解决这个问题,这就要用到调色板这个概念。为何要使用调色板我们在此并不作详细讨论,只是有一点要弄明白,只有十六色和二百五十六色位图才需要调色板。</td></tr></table><table width=100% ><tr><td class=a14>
下面是使用调色板的方法</td></tr></table><table width=100% ><tr><td class=a14>
首先要读入一个位图文件,再判断这个位图文件的颜色数,假如这个文件是十六色或是二百五六色,那么这个文件中必会有一个调色板信息,读取这个调色板信息,将这个调色板信息转为一个LOGPALETTE的结构,根据这个结构生成逻辑调色板,然后每次在要显示位图前,使用SelectPalette函数将逻辑调色板选入设备描述表hDC,再使用RealizePalette函数实现这个调色板,当显示完成后再使用SelectPalette函数,将旧的调色板选择回来,一个调色板调用过程就完成了。</td></tr></table>
  <table width=100% >
    <tr> 
      <td class=a14><font color="#CC0000"> 构造windows图像处理类库</font></td>

⌨️ 快捷键说明

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