﻿<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>C++博客-vfdff-文章分类-技术</title><link>http://www.cppblog.com/vfdff/category/6742.html</link><description /><language>zh-cn</language><lastBuildDate>Tue, 20 May 2008 15:50:32 GMT</lastBuildDate><pubDate>Tue, 20 May 2008 15:50:32 GMT</pubDate><ttl>60</ttl><item><title>自动截屏到文件的小程序</title><link>http://www.cppblog.com/vfdff/articles/48143.html</link><dc:creator>vfdff</dc:creator><author>vfdff</author><pubDate>Fri, 25 Apr 2008 09:43:00 GMT</pubDate><guid>http://www.cppblog.com/vfdff/articles/48143.html</guid><wfw:comment>http://www.cppblog.com/vfdff/comments/48143.html</wfw:comment><comments>http://www.cppblog.com/vfdff/articles/48143.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/vfdff/comments/commentRss/48143.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/vfdff/services/trackbacks/48143.html</trackback:ping><description><![CDATA[<p>（一）功能<br>实现了一个定时截取当前屏幕图像的小程序。</p>
<p>（二）准备工作<br>1）建立VC CONSOLE APPLICATION，选择MFC SUPPORT<br>2）在STDAFX.H文件中加入头文件：conio.h</p>
<p>（三）主程序<br>主程序代码如下：<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; char Filename[100];<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; int count = 0;</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; while(!_kbhit())//用户按键则退出<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Sleep(5000);//挂起5秒</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; count ++;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; sprintf(Filename, "%d.bmp", count);</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Screen(Filename);//调用Screen函数<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>以上代码每隔5秒钟调用一次函数Screen，将当前屏幕保存到文件中。</p>
<p>（四）工作函数Screen<br>Screen实现了当前屏幕内容到bmp文件的拷贝。<br>源代码如下：<br>void Screen(char filename[])<br>{<br>&nbsp;&nbsp;&nbsp; CDC *pDC;//屏幕DC<br>&nbsp;&nbsp;&nbsp; pDC = CDC::FromHandle(GetDC(NULL));//获取当前整个屏幕DC<br>&nbsp;&nbsp;&nbsp; int BitPerPixel = pDC-&gt;GetDeviceCaps(BITSPIXEL);//获得颜色模式<br>&nbsp;&nbsp;&nbsp; int Width = pDC-&gt;GetDeviceCaps(HORZRES);<br>&nbsp;&nbsp;&nbsp; int Height = pDC-&gt;GetDeviceCaps(VERTRES);</p>
<p>&nbsp;&nbsp;&nbsp; cout &lt;&lt; "当前屏幕色彩模式为" &lt;&lt; BitPerPixel &lt;&lt; "位色彩" &lt;&lt; endl<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;&lt; "屏幕宽度：" &lt;&lt; Width &lt;&lt; endl<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;&lt; "屏幕高度：" &lt;&lt; Height &lt;&lt; endl &lt;&lt; endl;<br>&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; CDC memDC;//内存DC<br>&nbsp;&nbsp;&nbsp; memDC.CreateCompatibleDC(pDC);<br>&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; CBitmap memBitmap, *oldmemBitmap;//建立和屏幕兼容的bitmap<br>&nbsp;&nbsp;&nbsp; memBitmap.CreateCompatibleBitmap(pDC, Width, Height);</p>
<p>&nbsp;&nbsp;&nbsp; oldmemBitmap = memDC.SelectObject(&amp;memBitmap);//将memBitmap选入内存DC<br>&nbsp;&nbsp;&nbsp; memDC.BitBlt(0, 0, Width, Height, pDC, 0, 0, SRCCOPY);//复制屏幕图像到内存DC</p>
<p>&nbsp;&nbsp;&nbsp; //以下代码保存memDC中的位图到文件<br>&nbsp;&nbsp;&nbsp; BITMAP bmp;<br>&nbsp;&nbsp;&nbsp; memBitmap.GetBitmap(&amp;bmp);//获得位图信息<br>&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; FILE *fp = fopen(filename, "w+b");</p>
<p>&nbsp;&nbsp;&nbsp; BITMAPINFOHEADER bih = {0};//位图信息头<br>&nbsp;&nbsp;&nbsp; bih.biBitCount = bmp.bmBitsPixel;//每个像素字节大小<br>&nbsp;&nbsp;&nbsp; bih.biCompression = BI_RGB;<br>&nbsp;&nbsp;&nbsp; bih.biHeight = bmp.bmHeight;//高度<br>&nbsp;&nbsp;&nbsp; bih.biPlanes = 1;<br>&nbsp;&nbsp;&nbsp; bih.biSize = sizeof(BITMAPINFOHEADER);<br>&nbsp;&nbsp;&nbsp; bih.biSizeImage = bmp.bmWidthBytes * bmp.bmHeight;//图像数据大小<br>&nbsp;&nbsp;&nbsp; bih.biWidth = bmp.bmWidth;//宽度<br>&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; BITMAPFILEHEADER bfh = {0};//位图文件头<br>&nbsp;&nbsp;&nbsp; bfh.bfOffBits = sizeof(BITMAPFILEHEADER) + sizeof(BITMAPINFOHEADER);//到位图数据的偏移量<br>&nbsp;&nbsp;&nbsp; bfh.bfSize = bfh.bfOffBits + bmp.bmWidthBytes * bmp.bmHeight;//文件总的大小<br>&nbsp;&nbsp;&nbsp; bfh.bfType = (WORD)0x4d42;<br>&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; fwrite(&amp;bfh, 1, sizeof(BITMAPFILEHEADER), fp);//写入位图文件头<br>&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; fwrite(&amp;bih, 1, sizeof(BITMAPINFOHEADER), fp);//写入位图信息头<br>&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; byte * p = new byte[bmp.bmWidthBytes * bmp.bmHeight];//申请内存保存位图数据</p>
<p>&nbsp;&nbsp;&nbsp; GetDIBits(memDC.m_hDC, (HBITMAP) memBitmap.m_hObject, 0, Height, p, <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (LPBITMAPINFO) &amp;bih, DIB_RGB_COLORS);//获取位图数据</p>
<p>&nbsp;&nbsp;&nbsp; fwrite(p, 1, bmp.bmWidthBytes * bmp.bmHeight, fp);//写入位图数据</p>
<p>&nbsp;&nbsp;&nbsp; delete [] p;</p>
<p>&nbsp;&nbsp;&nbsp; fclose(fp);</p>
<p>&nbsp;&nbsp;&nbsp; memDC.SelectObject(oldmemBitmap);<br>}</p>
<p>（五）改进<br>可以在系统热键中加入自定义热键，进行动态的（按用户需要的）截屏操作。&nbsp; </p>
<img src ="http://www.cppblog.com/vfdff/aggbug/48143.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/vfdff/" target="_blank">vfdff</a> 2008-04-25 17:43 <a href="http://www.cppblog.com/vfdff/articles/48143.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>图片格式整理（增加alcatel）</title><link>http://www.cppblog.com/vfdff/articles/47008.html</link><dc:creator>vfdff</dc:creator><author>vfdff</author><pubDate>Sun, 13 Apr 2008 16:43:00 GMT</pubDate><guid>http://www.cppblog.com/vfdff/articles/47008.html</guid><wfw:comment>http://www.cppblog.com/vfdff/comments/47008.html</wfw:comment><comments>http://www.cppblog.com/vfdff/articles/47008.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/vfdff/comments/commentRss/47008.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/vfdff/services/trackbacks/47008.html</trackback:ping><description><![CDATA[<span class="unnamed3">铃声图片格式<br>Motorola<br>普通铃声格式<br>【格式】<br>＜Header＞＜Tempo Value＞＜Musical Data＞＜Delimiter＞＜Checksum＞
<p>【说明】</p>
<p>Header:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; unsigned char 4Byte (所有的铃声都是一样的header)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br>&nbsp;&nbsp; Values:&nbsp;&nbsp;&nbsp;&nbsp;4c 33 35 26&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --＞"L35"<br>Tempo Value： unsigned char&nbsp;&nbsp;2Byte 拍子，由1或2或3或4加空格构成，缺省为2，<br>Values:&nbsp;&nbsp;&nbsp;&nbsp;32 20&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --＞"2 "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br>Musical Data：nByte 二进制数据<br>Delimiter： unsigned char 2 Byte 分隔符&nbsp;&nbsp; values:&nbsp;&nbsp;26 26&nbsp;&nbsp; --＞""<br>Checksum：
2Byte&nbsp;&nbsp;对Musical Data进行的校验和，两个字节。方法为对Musical
Data中的数据从前往后对每个字符进行异或运算，运算的结果假设其十六进制的表示为XY，那Checksum的第一个字节的十六进制形式为3Y，第二个
字节的十六进制形式为3X。<br>&nbsp;&nbsp;计算方式：<br>Step1: Calculate one byte XOR sum of the all the bytes of the musical data starting after<br>the space in the tempo value(not including space) till the (not inclusive of ). Let<br>us say this is XY.<br>&nbsp;&nbsp; Step 2: Separate X and Y into two bytes X0 and 0Y.<br>&nbsp;&nbsp; Step 3: Take 0Y and add hex 30. This becomes 3Y. Call this byte 1.<br>&nbsp;&nbsp; Step 4: Take X0 and shift right by 4 bits. This becomes 0X.<br>&nbsp;&nbsp; Step 5: Add hex 30 to 0X. This becomes 3X. Call this byte 2.<br>&nbsp;&nbsp; Step 6: Two byte checksum is ＜byte 2＞＜byte1＞<br>NOKIA<br>普通铃声格式 </p>
<p>普通图片(Operator Logo)<br>【格式】 <br>＜command＞＜otb_bmp ＞<br>【说明】<br>＜command＞ = ＜UDH＞＜IEI＞＜IEIL＞＜IED＞＜ MCC＞ ＜ MNC＞<br>UDHI IEI IEIL IED MCC MNC<br>06H 05H 04H 1582H&nbsp;&nbsp;0000H 64F0 00</p>
<p><br>以上适用于china moblie</p>
<p>UDHI: byte&nbsp;&nbsp;length of user-data header&nbsp;&nbsp;define: 06H&nbsp;&nbsp;(用户数据头)<br>&nbsp;&nbsp;IEI:&nbsp;&nbsp;byte&nbsp;&nbsp;Information Element Identifier&nbsp;&nbsp;define; 05h （IE info ）<br>&nbsp;&nbsp;IEIL:&nbsp;&nbsp;byte length of IEI data&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;define: 04h&nbsp;&nbsp;(IE长度)<br>&nbsp;&nbsp;IED:&nbsp;&nbsp;unsinge int 2 bytes&nbsp;&nbsp;, octets 4 5 define: 5506--＞ 1582H - destination port<br>&nbsp;&nbsp;IED:&nbsp;&nbsp;unsinge int 2 bytes&nbsp;&nbsp;, octets 6 7 define: 0000 - originator port<br>MCC:&nbsp;&nbsp;(Mobile
Country Code), octets 14 and 15, little-endian BCD, filled with F16',
460 -＞ 64 F0, For ChinaNotice: To see the logo on the phone's screen,
octets 8 and 9 must be defined with the settings of the current
operator. （国家代码）<br>MNC: Mobile Network Code) coding, little-endian BCD, filled with F16', 00-＞00, For ChinaMobile is 00, China CUGSM is 01 (网络代码)<br>Otb-bmp：otb格式，<br>＜OTA Bitmap＞ ::= ＜header＞ ＜image-data ＞ [ ＜palette ＞ ]<br>＜header＞ ::= ＜infofield ＞[extfield]＜width＞＜height ＞＜depth＞<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; infofield 8bit 图片信息区具体表示如下：<br>Bit&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Info Field&nbsp;&nbsp;,&nbsp;&nbsp; description <br>7 分割标志 1：分割图片（后面还有）0：否<br>6 压缩标志 1：压缩 0：没有压缩<br>5 扩展调色板 1：使用&nbsp;&nbsp;0：没有使用<br>4 Max size of icon&nbsp;&nbsp;1:16bit ,0:8bit<br>3 Number of animated icons, msb<br>2 Number of animated icons<br>1 Number of animated icons<br>0 Number of animated icons,lst</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Extended infofield 8bit 图片信息区具体表示如下：<br>Bit&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ExtField&nbsp;&nbsp;,&nbsp;&nbsp; description <br>7 分割标志 1：分割图片（后面还有）0：否<br>6 Bmp版本<br>5 Bmp版本<br>4 Bmp<br>3 保留<br>2 保留<br>1 保留<br>0 保留</p>
<p>Width：&nbsp;&nbsp;&nbsp;&nbsp;图片的宽度。对于Operator Log&nbsp;&nbsp; Width =72&nbsp;&nbsp;48H<br>Height：&nbsp;&nbsp;&nbsp;&nbsp;图片的高度。 对于Operator Log&nbsp;&nbsp;Heigth=14&nbsp;&nbsp;04H <br>Depth：&nbsp;&nbsp;&nbsp;&nbsp; 图片的深度，灰度值或者颜色数。<br>Image-Data：图片点阵<br>，当图片的大小为72X14时候，每一个byte就表示8个点，一行有72个点，因此每行需要9bytes，由于是14行，因此需要的大小是9X14=126bytes。每一个bit，1表示黑色，0表示白色。<br>Alcatel<br>普通铃声格式<br>【格式】<br>＜Tp-UDL＞＜TP-UDHL＞<br>＜TDD-IEI＞＜TDD-Length＞＜TDD-Name-Length＞＜TDD-Name＞＜TDD-Data_Type＞＜TDD-Data-Length＞<br>＜ Concatenation -IEI ＞＜ Concatenation-Length ＞＜ Concatenation-Reference Number ＞]<br>＜ Concatenation-Maximum Number ＞＜ Concatenation-Sequence Number ＞<br>＜TDD-Data＞</p>
<p>【说明】</p>
<p>TP-UDL&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Byte&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //短信长度&nbsp;&nbsp; user data length&nbsp;&nbsp;max:-140 <br>TP-UDHL&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Byte&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//短信头长度&nbsp;&nbsp;user data head length&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br>-----------------------------------------------------------------------------------------------------------------<br>TDD-IEI&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Byte&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //阿尔卡特 sms标示&nbsp;&nbsp;=80&nbsp;&nbsp; type &#8221;download&#8221;<br>TDD-Length&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Byte&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //&nbsp;&nbsp;IE&nbsp;&nbsp;Length of the TDD_Header&nbsp;&nbsp;----end of IE<br>TDD-Name-Length Byte&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //Title/name length 标头名字长度 <br>TDD-Name&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; unsigned char [TDD-Name-Length]&nbsp;&nbsp;&nbsp;&nbsp;//标头名称 {字符 }<br>TDD-Data-Type&nbsp;&nbsp; Byte&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //TDD_Data_Type</p>
<p>注释:&nbsp;&nbsp;Bit 7:<br>&nbsp;&nbsp;&nbsp;&nbsp; 0: cannot be forwarded<br>&nbsp;&nbsp; 1: can be forwared using EMS<br>如果兼容EMS就设置为1 <br>Bit 4-6 unused<br>Bit 0-2<br>000:iMelody melody<br>001:iAlcatel Melody<br>010:MSEQ melody<br>011:VOX melody<br>100: Alcatel Picture&nbsp;&nbsp;<br>101:Alcatel animation<br>110:sms template<br>111.unused<br>TDD-Data-Length = unsigned int&nbsp;&nbsp;2 byte&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//TDD_data数据 长度 <br>Byte 1: MSB<br>Byte 2: LSB<br>// End of TDD header IE<br>// Start of Concatenation header IE &nbsp;&nbsp; //以下只是用于坼分短信<br>Concatenation-IEI&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Byte &nbsp;&nbsp;&nbsp;&nbsp;//IEI=00<br>Concatenation-Length&nbsp;&nbsp; &nbsp;&nbsp; Byte&nbsp;&nbsp;&nbsp;&nbsp; //IEDL=03<br>Concatenation-Reference Number&nbsp;&nbsp;&nbsp;&nbsp;Byte&nbsp;&nbsp;&nbsp;&nbsp; // 序列号？？（same as all segrments）125<br>Concatenation-Maximum Number&nbsp;&nbsp;&nbsp;&nbsp;Byte&nbsp;&nbsp;&nbsp;&nbsp;//总条数 （same as all segrments）<br>Concatenation-Sequence Number&nbsp;&nbsp;&nbsp;&nbsp;Byte&nbsp;&nbsp;&nbsp;&nbsp; //当前序列号<br>// End of Concatenation header IE<br>// End of User Data Header</p>
<p>TDD-Data =&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //TDD_DATA 数据 二进制流<br><br>普通图片<br>(同铃声格式)</p>
<p><br>SIEMENS<br>普通铃声格式<br>【格式】<br>＜Identifier＞＜Version＞＜DataSize＞＜ReferenceID＞＜ActPacketNumber＞＜NumberOfPackets＞＜ObjectSize＞ ＜ObjectType＞＜ObjectName＞＜Data＞<br>---------------------------------------------------------------------------------------------------------------------------------<br>【说明】<br>Identifier： ASCII&nbsp;&nbsp;5 byte&nbsp;&nbsp;标识。设为&#8221;//SEO&#8221;（注意大小写）(SEQ stands for Siemens Exchange OBject)<br>Version：&nbsp;&nbsp;unsigned char&nbsp;&nbsp; 版本号。设为1<br>DataSize： unsigned int&nbsp;&nbsp;2 byte&nbsp;&nbsp;数据大小。每个包里可mid数据的大小，对于同一mid的不同包的该值相同，最后一个包里实际剩余数据大小不足时，添0补足 <br>最大值为：140-22-Length(objname)-Leng(objType) in Byte<br>ReferenceID：unsigned long 4字节 序列号。可自行设定，对同一首mid的不同包的该值相同<br>ActPacketNumber：unsigned int 2字节当前包是第几包。从1开始计数<br>NumberOfPackets：unsigned int 2字节 总包数。<br>ObjectSize：unsigned long 4字节mid的大小。The total of the dataobject in Byte<br>ObjectType：string 1Byte+x (x＞0) 类型为mid。。第一字节为长度，因为类型为&#8221;mid&#8221;所以第一字节为3，第二至第四字节为&#8221;mid&#8221; <br>ObjectNam&nbsp;&nbsp;string 1byte+y&nbsp;&nbsp;mid的名称，包括扩展名。长度不定。第一个字节为长度。如歌曲为&#8221;甜蜜蜜.mid&#8221;，则ObjectName的长度为10，第一个字节为10。第二至十个字节为&#8221; 甜蜜蜜.mid&#8221;<br>Resulting size:&nbsp;&nbsp;22 Byte +x+y<br>Data：mid数据。从mid文件中拆分出来的数据。<br>普通图片<br>【格式】<br>＜Identifier＞＜Version＞＜DataSize＞＜ReferenceID＞＜ActPacketNumber＞＜NumberOfPackets＞＜ObjectSize＞ ＜ObjectType＞＜ObjectName＞＜Data＞<br>-------------------------------------------------------------------------------------------------------------------------------------<br>【说明】<br>Identifier： ASCII&nbsp;&nbsp;5 byte&nbsp;&nbsp;标识。设为&#8221;//SEO&#8221;（注意大小写）(SEQ stands for Siemens Exchange OBject)<br>Version：&nbsp;&nbsp;unsigned char 1 byte&nbsp;&nbsp;版本号。设为1<br>DataSize： unsigned int&nbsp;&nbsp;2 byte&nbsp;&nbsp;数据大小。每个包里可bmp数据的大小，对于的不同包的该值相同，最后一个包里实际剩余数据大小不足时，添0补足 <br>最大值为：140-22-Length(objname)-Leng(objType) in Byte<br>ReferenceID：unsigned long 4字节 序列号。可自行设定，对同一副图片的不同包的该值相同<br>ActPacketNumber：unsigned int 2字节当前包是第几包。从1开始计数<br>NumberOfPackets：unsigned int 2字节 总包数。<br>ObjectSize：unsigned long 4字节mid的大小。The total of the dataobject in Byte<br>ObjectType：string 1Byte+x (x＞0) 类型为bmp。。第一字节为长度，因为类型为&#8221;bmp&#8221;所以第一字节为3，第二至第四字节为&#8221;bmp&#8221; <br>ObjectName&nbsp;&nbsp;string 1byte+y&nbsp;&nbsp;mid的名称，包括扩展名。长度不定。第一个字节为长度。如歌曲为&#8221;1234.bmp&#8221;，则ObjectName的长度为8，第一个字节为8。第二至十个字节为&#8221;1234.bmp&#8221;<br>Resulting size:&nbsp;&nbsp;22 Byte +x+y<br>Data：mid数据。从bmp文件中拆分出来的数据。</p>
</span><img src ="http://www.cppblog.com/vfdff/aggbug/47008.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/vfdff/" target="_blank">vfdff</a> 2008-04-14 00:43 <a href="http://www.cppblog.com/vfdff/articles/47008.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>