代码语言
.
CSharp
.
JS
Java
Asp.Net
C
MSSQL
PHP
Css
PLSQL
Python
Shell
EBS
ASP
Perl
ObjC
VB.Net
VBS
MYSQL
GO
Delphi
AS
DB2
Domino
Rails
ActionScript
Scala
代码分类
文件
系统
字符串
数据库
网络相关
图形/GUI
多媒体
算法
游戏
Jquery
Extjs
Android
HTML5
菜单
网页交互
WinForm
控件
企业应用
安全与加密
脚本/批处理
开放平台
其它
【
CSharp
】
用c#怎么比较两张图片的不同
作者:
Backkoms
/ 发布于
2012/3/13
/
666
清除浏览器缓存
<div> <div class="container"> <div class="line number1 index0 alt2">"csharp keyword">using "csharp plain">System;</div> <div class="line number2 index1 alt1">"csharp keyword">using "csharp plain">System.Data;</div> <div class="line number3 index2 alt2">"csharp keyword">using "csharp plain">System.Configuration;</div> <div class="line number4 index3 alt1">"csharp keyword">using "csharp plain">System.Web;</div> <div class="line number5 index4 alt2">"csharp keyword">using "csharp plain">System.Web.Security;</div> <div class="line number6 index5 alt1">"csharp keyword">using "csharp plain">System.Web.UI;</div> <div class="line number7 index6 alt2">"csharp keyword">using "csharp plain">System.Web.UI.WebControls;</div> <div class="line number8 index7 alt1">"csharp keyword">using "csharp plain">System.Web.UI.WebControls.WebParts;</div> <div class="line number9 index8 alt2">"csharp keyword">using "csharp plain">System.Web.UI.HtmlControls;</div> <div class="line number10 index9 alt1">"csharp keyword">using "csharp plain">System.Drawing;</div> <div class="line number11 index10 alt2">"csharp keyword">using "csharp plain">System.Drawing.Imaging;</div> <div class="line number12 index11 alt1">"csharp keyword">using "csharp plain">System.Runtime.InteropServices;</div> <div class="line number13 index12 alt2"></div> <div class="line number14 index13 alt1">"csharp color1">/// <summary></div> <div class="line number15 index14 alt2">"csharp color1">/// ImageEx 的摘要说明</div> <div class="line number16 index15 alt1">"csharp color1">/// </summary></div> <div class="line number17 index16 alt2">"csharp keyword">public "csharp keyword">class "csharp plain">ImageEx</div> <div class="line number18 index17 alt1">"csharp plain">{</div> <div class="line number19 index18 alt2">"csharp keyword">public "csharp plain">ImageEx()</div> <div class="line number20 index19 alt1">"csharp plain">{</div> <div class="line number21 index20 alt2">"csharp comments">//</div> <div class="line number22 index21 alt1">"csharp comments">// TODO: 在此处添加构造函数逻辑</div> <div class="line number23 index22 alt2">"csharp comments">//</div> <div class="line number24 index23 alt1">"csharp plain">}</div> <div class="line number25 index24 alt2"></div> <div class="line number26 index25 alt1">"csharp color1">/// <summary></div> <div class="line number27 index26 alt2">"csharp color1">/// 比较两幅图片是否一致(使用Bitmap.GetPixel方式)</div> <div class="line number28 index27 alt1">"csharp color1">/// </summary></div> <div class="line number29 index28 alt2">"csharp color1">/// <param name="bitmap1">图片1</param></div> <div class="line number30 index29 alt1">"csharp color1">/// <param name="bitmap2">图片2</param></div> <div class="line number31 index30 alt2">"csharp color1">/// <returns>如果两幅图片相同,返回0;如果图片1小于图片2,返回小于0的值;如果图片1大于图片2,返回大于0的值。</returns></div> <div class="line number32 index31 alt1">"csharp keyword">public "csharp keyword">static "csharp keyword">int "csharp plain">BitmapCompare(Bitmap bitmap1, Bitmap bitmap2)</div> <div class="line number33 index32 alt2">"csharp plain">{</div> <div class="line number34 index33 alt1">"csharp keyword">int "csharp plain">result = 0; "csharp comments">//假设两幅图片相同</div> <div class="line number35 index34 alt2">"csharp keyword">if "csharp plain">(bitmap1 == "csharp keyword">null "csharp plain">|| bitmap2 == "csharp keyword">null"csharp plain">)</div> <div class="line number36 index35 alt1">"csharp keyword">return "csharp plain">-1;</div> <div class="line number37 index36 alt2">"csharp keyword">if "csharp plain">(bitmap1.Width == bitmap2.Width && bitmap1.Height == bitmap2.Height)</div> <div class="line number38 index37 alt1">"csharp plain">{</div> <div class="line number39 index38 alt2">"csharp keyword">for "csharp plain">("csharp keyword">int "csharp plain">i = 0; i < bitmap1.Width; i++)</div> <div class="line number40 index39 alt1">"csharp plain">{</div> <div class="line number41 index40 alt2">"csharp keyword">for "csharp plain">("csharp keyword">int "csharp plain">j = 0; j < bitmap1.Height; j++)</div> <div class="line number42 index41 alt1">"csharp plain">{</div> <div class="line number43 index42 alt2">"csharp plain">Color color1 = bitmap1.GetPixel(i, j);</div> <div class="line number44 index43 alt1">"csharp plain">Color color2 = bitmap2.GetPixel(i, j);</div> <div class="line number45 index44 alt2">"csharp keyword">if "csharp plain">(color1 != color2)</div> <div class="line number46 index45 alt1">"csharp plain">{</div> <div class="line number47 index46 alt2">"csharp plain">result = color1.ToArgb() - color2.ToArgb();</div> <div class="line number48 index47 alt1">"csharp keyword">break"csharp plain">;</div> <div class="line number49 index48 alt2">"csharp plain">}</div> <div class="line number50 index49 alt1">"csharp plain">}</div> <div class="line number51 index50 alt2">"csharp keyword">if "csharp plain">(result != 0)</div> <div class="line number52 index51 alt1">"csharp keyword">break"csharp plain">;</div> <div class="line number53 index52 alt2">"csharp plain">}</div> <div class="line number54 index53 alt1">"csharp plain">}</div> <div class="line number55 index54 alt2">"csharp keyword">else "csharp keyword">if "csharp plain">(bitmap1.Width != bitmap2.Width)</div> <div class="line number56 index55 alt1">"csharp plain">{</div> <div class="line number57 index56 alt2">"csharp plain">result = bitmap1.Width - bitmap2.Width;</div> <div class="line number58 index57 alt1">"csharp plain">}</div> <div class="line number59 index58 alt2">"csharp keyword">else "csharp keyword">if "csharp plain">(bitmap1.Height != bitmap2.Height)</div> <div class="line number60 index59 alt1">"csharp plain">{</div> <div class="line number61 index60 alt2">"csharp plain">result = bitmap1.Height - bitmap2.Height;</div> <div class="line number62 index61 alt1">"csharp plain">}</div> <div class="line number63 index62 alt2">"csharp keyword">return "csharp plain">result;</div> <div class="line number64 index63 alt1">"csharp plain">}</div> <div class="line number65 index64 alt2"></div> <div class="line number66 index65 alt1">"csharp color1">/// <summary></div> <div class="line number67 index66 alt2">"csharp color1">/// 比较两幅图片是否一致(使用memcmp方式)</div> <div class="line number68 index67 alt1">"csharp color1">/// </summary></div> <div class="line number69 index68 alt2">"csharp color1">/// <param name="bitmap1">图片1</param></div> <div class="line number70 index69 alt1">"csharp color1">/// <param name="bitmap2">图片2</param></div> <div class="line number71 index70 alt2">"csharp color1">/// <returns>如果两幅图片相同,返回0;如果图片1小于图片2,返回小于0的值;如果图片1大于图片2,返回大于0的值。</returns></div> <div class="line number72 index71 alt1">"csharp keyword">public "csharp keyword">static "csharp keyword">int "csharp plain">BitmapCompare2(Bitmap bitmap1, Bitmap bitmap2)</div> <div class="line number73 index72 alt2">"csharp plain">{</div> <div class="line number74 index73 alt1">"csharp keyword">int "csharp plain">result = 0; "csharp comments">//假设两幅图片相同</div> <div class="line number75 index74 alt2">"csharp keyword">if "csharp plain">(bitmap1 == "csharp keyword">null "csharp plain">|| bitmap2 == "csharp keyword">null"csharp plain">)</div> <div class="line number76 index75 alt1">"csharp keyword">return "csharp plain">-1;</div> <div class="line number77 index76 alt2">"csharp keyword">if "csharp plain">(bitmap1.Width == bitmap2.Width && bitmap1.Height == bitmap2.Height)</div> <div class="line number78 index77 alt1">"csharp plain">{</div> <div class="line number79 index78 alt2">"csharp plain">BitmapData bmd1 = bitmap1.LockBits("csharp keyword">new "csharp plain">Rectangle(0, 0, bitmap1.Width, bitmap1.Height), ImageLockMode.ReadOnly, bitmap1.PixelFormat);</div> <div class="line number80 index79 alt1">"csharp plain">BitmapData bmd2 = bitmap2.LockBits("csharp keyword">new "csharp plain">Rectangle(0, 0, bitmap2.Width, bitmap2.Height), ImageLockMode.ReadOnly, bitmap2.PixelFormat);</div> <div class="line number81 index80 alt2">"csharp keyword">int "csharp plain">bytes = bmd1.Stride * bitmap1.Height;</div> <div class="line number82 index81 alt1">"csharp keyword">byte"csharp plain">[] buff1 = "csharp keyword">new "csharp keyword">byte"csharp plain">[bytes];</div> <div class="line number83 index82 alt2">"csharp keyword">byte"csharp plain">[] buff2 = "csharp keyword">new "csharp keyword">byte"csharp plain">[bytes];</div> <div class="line number84 index83 alt1">"csharp plain">Marshal.Copy(bmd1.Scan0, buff1, 0, Marshal.SizeOf("csharp keyword">typeof"csharp plain">("csharp keyword">byte"csharp plain">)) * bytes);</div> <div class="line number85 index84 alt2">"csharp plain">Marshal.Copy(bmd2.Scan0, buff2, 0, Marshal.SizeOf("csharp keyword">typeof"csharp plain">("csharp keyword">byte"csharp plain">)) * bytes);</div> <div class="line number86 index85 alt1">"csharp plain">result = MemoryCompare(buff1, buff2);</div> <div class="line number87 index86 alt2">"csharp plain">bitmap1.UnlockBits(bmd1);</div> <div class="line number88 index87 alt1">"csharp plain">bitmap2.UnlockBits(bmd2);</div> <div class="line number89 index88 alt2">"csharp plain">}</div> <div class="line number90 index89 alt1">"csharp keyword">else "csharp keyword">if "csharp plain">(bitmap1.Width != bitmap2.Width)</div> <div class="line number91 index90 alt2">"csharp plain">{</div> <div class="line number92 index91 alt1">"csharp plain">result = bitmap1.Width - bitmap2.Width;</div> <div class="line number93 index92 alt2">"csharp plain">}</div> <div class="line number94 index93 alt1">"csharp keyword">else "csharp keyword">if "csharp plain">(bitmap1.Height != bitmap2.Height)</div> <div class="line number95 index94 alt2">"csharp plain">{</div> <div class="line number96 index95 alt1">"csharp plain">result = bitmap1.Height - bitmap2.Height;</div> <div class="line number97 index96 alt2">"csharp plain">}</div> <div class="line number98 index97 alt1">"csharp keyword">return "csharp plain">result;</div> <div class="line number99 index98 alt2">"csharp plain">}</div> <div class="line number100 index99 alt1"></div> <div class="line number101 index100 alt2">"csharp color1">/// <summary></div> <div class="line number102 index101 alt1">"csharp color1">/// 比较两幅图片是否一致(使用Marshal.ReadByte方式)</div> <div class="line number103 index102 alt2">"csharp color1">/// </summary></div> <div class="line number104 index103 alt1">"csharp color1">/// <param name="bitmap1">图片1</param></div> <div class="line number105 index104 alt2">"csharp color1">/// <param name="bitmap2">图片2</param></div> <div class="line number106 index105 alt1">"csharp color1">/// <returns>如果两幅图片相同,返回0;如果图片1小于图片2,返回小于0的值;如果图片1大于图片2,返回大于0的值。</returns></div> <div class="line number107 index106 alt2">"csharp keyword">public "csharp keyword">static "csharp keyword">int "csharp plain">BitmapCompare3(Bitmap bitmap1, Bitmap bitmap2)</div> <div class="line number108 index107 alt1">"csharp plain">{</div> <div class="line number109 index108 alt2">"csharp keyword">int "csharp plain">result = 0; "csharp comments">//假设两幅图片相同</div> <div class="line number110 index109 alt1">"csharp keyword">if "csharp plain">(bitmap1 == "csharp keyword">null "csharp plain">|| bitmap2 == "csharp keyword">null"csharp plain">)</div> <div class="line number111 index110 alt2">"csharp keyword">return "csharp plain">-1;</div> <div class="line number112 index111 alt1">"csharp keyword">if "csharp plain">(bitmap1.Width == bitmap2.Width && bitmap1.Height == bitmap2.Height)</div> <div class="line number113 index112 alt2">"csharp plain">{</div> <div class="line number114 index113 alt1">"csharp plain">BitmapData bmd1 = bitmap1.LockBits("csharp keyword">new "csharp plain">Rectangle(0, 0, bitmap1.Width, bitmap1.Height), ImageLockMode.ReadOnly, bitmap1.PixelFormat);</div> <div class="line number115 index114 alt2">"csharp plain">BitmapData bmd2 = bitmap2.LockBits("csharp keyword">new "csharp plain">Rectangle(0, 0, bitmap2.Width, bitmap2.Height), ImageLockMode.ReadOnly, bitmap2.PixelFormat);</div> <div class="line number116 index115 alt1">"csharp plain">IntPtr start1 = bmd1.Scan0;</div> <div class="line number117 index116 alt2">"csharp plain">IntPtr start2 = bmd2.Scan0;</div> <div class="line number118 index117 alt1">"csharp keyword">int "csharp plain">sizeOfByte = Marshal.SizeOf("csharp keyword">typeof"csharp plain">("csharp keyword">byte"csharp plain">));</div> <div class="line number119 index118 alt2">"csharp keyword">for "csharp plain">("csharp keyword">int "csharp plain">i = 0; i < sizeOfByte * bmd1.Stride * bitmap1.Height; i++)</div> <div class="line number120 index119 alt1">"csharp plain">{</div> <div class="line number121 index120 alt2">"csharp keyword">byte "csharp plain">b1 = Marshal.ReadByte(start1, i);</div> <div class="line number122 index121 alt1">"csharp keyword">byte "csharp plain">b2 = Marshal.ReadByte(start2, i);</div> <div class="line number123 index122 alt2">"csharp keyword">if "csharp plain">(b1 != b2)</div> <div class="line number124 index123 alt1">"csharp plain">{</div> <div class="line number125 index124 alt2">"csharp plain">result = ("csharp keyword">int"csharp plain">)(b1 - b2);</div> <div class="line number126 index125 alt1">"csharp keyword">break"csharp plain">;</div> <div class="line number127 index126 alt2">"csharp plain">}</div> <div class="line number128 index127 alt1">"csharp plain">}</div> <div class="line number129 index128 alt2">"csharp plain">bitmap1.UnlockBits(bmd1);</div> <div class="line number130 index129 alt1">"csharp plain">bitmap2.UnlockBits(bmd2);</div> <div class="line number131 index130 alt2">"csharp plain">}</div> <div class="line number132 index131 alt1">"csharp keyword">else "csharp keyword">if "csharp plain">(bitmap1.Width != bitmap2.Width)</div> <div class="line number133 index132 alt2">"csharp plain">{</div> <div class="line number134 index133 alt1">"csharp plain">result = bitmap1.Width - bitmap2.Width;</div> <div class="line number135 index134 alt2">"csharp plain">}</div> <div class="line number136 index135 alt1">"csharp keyword">else "csharp keyword">if "csharp plain">(bitmap1.Height != bitmap2.Height)</div> <div class="line number137 index136 alt2">"csharp plain">{</div> <div class="line number138 index137 alt1">"csharp plain">result = bitmap1.Height - bitmap2.Height;</div> <div class="line number139 index138 alt2">"csharp plain">}</div> <div class="line number140 index139 alt1">"csharp keyword">return "csharp plain">result;</div> <div class="line number141 index140 alt2">"csharp plain">}</div> <div class="line number142 index141 alt1"></div> <div class="line number143 index142 alt2">"csharp color1">/// <summary></div> <div class="line number144 index143 alt1">"csharp color1">/// 比较两幅图片是否一致(使用自定义字节数组比较)</div> <div class="line number145 index144 alt2">"csharp color1">/// </summary></div> <div class="line number146 index145 alt1">"csharp color1">/// <param name="bitmap1">图片1</param></div> <div class="line number147 index146 alt2">"csharp color1">/// <param name="bitmap2">图片2</param></div> <div class="line number148 index147 alt1">"csharp color1">/// <returns>如果两幅图片相同,返回0;如果图片1小于图片2,返回小于0的值;如果图片1大于图片2,返回大于0的值。</returns></div> <div class="line number149 index148 alt2">"csharp keyword">public "csharp keyword">static "csharp keyword">int "csharp plain">BitmapCompare4(Bitmap bitmap1, Bitmap bitmap2)</div> <div class="line number150 index149 alt1">"csharp plain">{</div> <div class="line number151 index150 alt2">"csharp keyword">int "csharp plain">result = 0; "csharp comments">//假设两幅图片相同</div> <div class="line number152 index151 alt1">"csharp keyword">if "csharp plain">(bitmap1 == "csharp keyword">null "csharp plain">|| bitmap2 == "csharp keyword">null"csharp plain">)</div> <div class="line number153 index152 alt2">"csharp keyword">return "csharp plain">-1;</div> <div class="line number154 index153 alt1">"csharp keyword">if "csharp plain">(bitmap1.Width == bitmap2.Width && bitmap1.Height == bitmap2.Height)</div> <div class="line number155 index154 alt2">"csharp plain">{</div> <div class="line number156 index155 alt1">"csharp plain">BitmapData bmd1 = bitmap1.LockBits("csharp keyword">new "csharp plain">Rectangle(0, 0, bitmap1.Width, bitmap1.Height), ImageLockMode.ReadOnly, bitmap1.PixelFormat);</div> <div class="line number157 index156 alt2">"csharp plain">BitmapData bmd2 = bitmap2.LockBits("csharp keyword">new "csharp plain">Rectangle(0, 0, bitmap2.Width, bitmap2.Height), ImageLockMode.ReadOnly, bitmap2.PixelFormat);</div> <div class="line number158 index157 alt1">"csharp keyword">int "csharp plain">bytes = bmd1.Stride * bitmap1.Height;</div> <div class="line number159 index158 alt2">"csharp keyword">byte"csharp plain">[] buff1 = "csharp keyword">new "csharp keyword">byte"csharp plain">[bytes];</div> <div class="line number160 index159 alt1">"csharp keyword">byte"csharp plain">[] buff2 = "csharp keyword">new "csharp keyword">byte"csharp plain">[bytes];</div> <div class="line number161 index160 alt2">"csharp plain">Marshal.Copy(bmd1.Scan0, buff1, 0, Marshal.SizeOf("csharp keyword">typeof"csharp plain">("csharp keyword">byte"csharp plain">)) * bytes);</div> <div class="line number162 index161 alt1">"csharp plain">Marshal.Copy(bmd2.Scan0, buff2, 0, Marshal.SizeOf("csharp keyword">typeof"csharp plain">("csharp keyword">byte"csharp plain">)) * bytes);</div> <div class="line number163 index162 alt2">"csharp plain">result = MemoryCompare2(buff1, buff2);</div> <div class="line number164 index163 alt1">"csharp plain">bitmap1.UnlockBits(bmd1);</div> <div class="line number165 index164 alt2">"csharp plain">bitmap2.UnlockBits(bmd2);</div> <div class="line number166 index165 alt1">"csharp plain">}</div> <div class="line number167 index166 alt2">"csharp keyword">else "csharp keyword">if "csharp plain">(bitmap1.Width != bitmap2.Width)</div> <div class="line number168 index167 alt1">"csharp plain">{</div> <div class="line number169 index168 alt2">"csharp plain">result = bitmap1.Width - bitmap2.Width;</div> <div class="line number170 index169 alt1">"csharp plain">}</div> <div class="line number171 index170 alt2">"csharp keyword">else "csharp keyword">if "csharp plain">(bitmap1.Height != bitmap2.Height)</div> <div class="line number172 index171 alt1">"csharp plain">{</div> <div class="line number173 index172 alt2">"csharp plain">result = bitmap1.Height - bitmap2.Height;</div> <div class="line number174 index173 alt1">"csharp plain">}</div> <div class="line number175 index174 alt2">"csharp keyword">return "csharp plain">result;</div> <div class="line number176 index175 alt1">"csharp plain">}</div> <div class="line number177 index176 alt2"></div> <div class="line number178 index177 alt1">"csharp color1">/// <summary></div> <div class="line number179 index178 alt2">"csharp color1">/// 用memcmp比较字节数组</div> <div class="line number180 index179 alt1">"csharp color1">/// </summary></div> <div class="line number181 index180 alt2">"csharp color1">/// <param name="b1">字节数组1</param></div> <div class="line number182 index181 alt1">"csharp color1">/// <param name="b2">字节数组2</param></div> <div class="line number183 index182 alt2">"csharp color1">/// <returns>如果两个数组相同,返回0;如果数组1小于数组2,返回小于0的值;如果数组1大于数组2,返回大于0的值。</returns></div> <div class="line number184 index183 alt1">"csharp keyword">public "csharp keyword">static "csharp keyword">int "csharp plain">MemoryCompare("csharp keyword">byte"csharp plain">[] b1, "csharp keyword">byte"csharp plain">[] b2)</div> <div class="line number185 index184 alt2">"csharp plain">{</div> <div class="line number186 index185 alt1">"csharp plain">IntPtr retval = memcmp(b1, b2, "csharp keyword">new "csharp plain">IntPtr(b1.Length));</div> <div class="line number187 index186 alt2">"csharp keyword">return "csharp plain">retval.ToInt32();</div> <div class="line number188 index187 alt1">"csharp plain">}</div> <div class="line number189 index188 alt2"></div> <div class="line number190 index189 alt1">"csharp color1">/// <summary></div> <div class="line number191 index190 alt2">"csharp color1">/// 比较字节数组</div> <div class="line number192 index191 alt1">"csharp color1">/// </summary></div> <div class="line number193 index192 alt2">"csharp color1">/// <param name="b1">字节数组1</param></div> <div class="line number194 index193 alt1">"csharp color1">/// <param name="b2">字节数组2</param></div> <div class="line number195 index194 alt2">"csharp color1">/// <returns>如果两个数组相同,返回0;如果数组1小于数组2,返回小于0的值;如果数组1大于数组2,返回大于0的值。</returns></div> <div class="line number196 index195 alt1">"csharp keyword">public "csharp keyword">static "csharp keyword">int "csharp plain">MemoryCompare2("csharp keyword">byte"csharp plain">[] b1, "csharp keyword">byte"csharp plain">[] b2)</div> <div class="line number197 index196 alt2">"csharp plain">{</div> <div class="line number198 index197 alt1">"csharp keyword">int "csharp plain">result = 0;</div> <div class="line number199 index198 alt2">"csharp keyword">if "csharp plain">(b1.Length != b2.Length)</div> <div class="line number200 index199 alt1">"csharp plain">result = b1.Length - b2.Length;</div> <div class="line number201 index200 alt2">"csharp keyword">else</div> <div class="line number202 index201 alt1">"csharp plain">{</div> <div class="line number203 index202 alt2">"csharp keyword">for "csharp plain">("csharp keyword">int "csharp plain">i = 0; i < b1.Length; i++)</div> <div class="line number204 index203 alt1">"csharp plain">{</div> <div class="line number205 index204 alt2">"csharp keyword">if "csharp plain">(b1[i] != b2[i])</div> <div class="line number206 index205 alt1">"csharp plain">{</div> <div class="line number207 index206 alt2">"csharp plain">result = ("csharp keyword">int"csharp plain">)(b1[i] - b2[i]);</div> <div class="line number208 index207 alt1">"csharp keyword">break"csharp plain">;</div> <div class="line number209 index208 alt2">"csharp plain">}</div> <div class="line number210 index209 alt1">"csharp plain">}</div> <div class="line number211 index210 alt2">"csharp plain">}</div> <div class="line number212 index211 alt1">"csharp keyword">return "csharp plain">result;</div> <div class="line number213 index212 alt2">"csharp plain">}</div> <div class="line number214 index213 alt1"></div> <div class="line number215 index214 alt2">"csharp color1">/// <summary></div> <div class="line number216 index215 alt1">"csharp color1">/// memcmp API</div> <div class="line number217 index216 alt2">"csharp color1">/// </summary></div> <div class="line number218 index217 alt1">"csharp color1">/// <param name="b1">字节数组1</param></div> <div class="line number219 index218 alt2">"csharp color1">/// <param name="b2">字节数组2</param></div> <div class="line number220 index219 alt1">"csharp color1">/// <returns>如果两个数组相同,返回0;如果数组1小于数组2,返回小于0的值;如果数组1大于数组2,返回大于0的值。</returns></div> <div class="line number221 index220 alt2">"csharp plain">[DllImport("csharp string">"msvcrt.dll""csharp plain">)]</div> <div class="line number222 index221 alt1">"csharp keyword">private "csharp keyword">static "csharp keyword">extern "csharp plain">IntPtr memcmp("csharp keyword">byte"csharp plain">[] b1, "csharp keyword">byte"csharp plain">[] b2, IntPtr count);</div> <div class="line number223 index222 alt2">"csharp plain">}</div> </div> </div>
试试其它关键字
比较两张图片
同语言下
.
文件IO 操作类库
.
Check图片类型[JPEG(.jpg 、.jpeg),TIF,GIF,BMP,PNG,P
.
机器名和IP取得(IPV4 IPV6)
.
Tiff转换Bitmap
.
linqHelper
.
MadieHelper.cs
.
RegHelper.cs
.
如果关闭一个窗体后激活另一个窗体的事件或方法
.
创建日志通用类
.
串口辅助开发类
可能有用的
.
C#实现的html内容截取
.
List 切割成几份 工具类
.
SQL查询 多列合并成一行用逗号隔开
.
一行一行读取txt的内容
.
C#动态修改文件夹名称(FSO实现,不移动文件)
.
c# 移动文件或文件夹
.
c#图片添加水印
.
Java PDF转换成图片并输出给前台展示
.
网站后台修改图片尺寸代码
.
处理大图片在缩略图时的展示
Backkoms
贡献的其它代码
(
1
)
.
用c#怎么比较两张图片的不同
Copyright © 2004 - 2024 dezai.cn. All Rights Reserved
站长博客
粤ICP备13059550号-3