資源簡介
地圖下載工具代碼,可以下載各個圖層的地圖切片

代碼片段和文件信息
using?System;
using?System.Drawing;
using?System.IO;
namespace?ColorProcess
{
????public?class?CountSizeAndSingleColor
????{
?????
???????
????????private?long?totalFileSize;
????????private?long?total;
????????private?long?single;
????????private?string?targetdir;
????????private?string[]?singleImageSize?=?new?string[]{“908““122“};
????????public?CountSizeAndSingleColor(string?targetdir)
????????{
????????????this.targetdir?=?targetdir;
????????}
????????public?CountSizeAndSingleColor(string?text?string[]?singleImageSize)
????????{
????????????this.singleImageSize?=?singleImageSize;
????????????targetdir?=?text;
????????}
????????public?void?start()
????????{
????????????doWork(targetdir);
????????????string?r?=?string.Format(“統計完畢:單色文件{0}?總數{1}?除去單色后總大小{2:.##}m“?single?total?totalFileSize/(1024*1024.0));
????????????File.WriteAllText(targetdir+“\\統計結果.txt“r);
??????????
????????}
????????private??void?doWork(string?dir)
????????{
???????????
????????????string[]?fs?=?Directory.GetFiles(dir?“*.gif“);
????????????foreach?(string?f?in?fs)
????????????{
????????????????total?+=?1;
????????????????FileInfo?fileInfo?=?new?FileInfo(f);
????????????????//if?(Array.IndexOf(singleImageSizefileInfo.Length.ToString())!=-1)
????????????????if?(fileInfo.Length==908)
????????????????{
????????????????????try
????????????????????{
????????????????????????Image?image?=?Image.FromFile(f);
????????????????????????Bitmap?bitmap?=?new?Bitmap(image);
????????????????????????Color?rgb;
????????????????????????//bool?isSingle?=?MapCache.IsSingleColor(image?out?rgb);
????????????????????????rgb?=?bitmap.GetPixel(0?0);
????????????????????????image.Dispose();
????????????????????????//如果是同色圖片
????????????????????????Byte[]?buf?=?new?byte[]?{?rgb.R?rgb.G?rgb.B?};
????????????????????????File.WriteAllBytes(f?buf);
????????????????????????single++;
????????????????????}
????????????????????catch?(Exception?e)
????????????????????{
????????????????????}
????????????????}
????????????????else
????????????????{
????????????????????totalFileSize?+=?fileInfo.Length;
????????????????}
???????????????
????????????}
????????????string[]?folders?=?Directory.GetDirectories(dir);
????????????foreach?(string?folder?in?folders)
????????????{
????????????????doWork(folder);
????????????}
????????}
????}
}
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件????????144??2013-04-26?10:32??GMapClient\app.config
?????文件???????6144??2013-04-26?10:33??GMapClient\bin\Debug\ColorProcess.exe
?????文件????????144??2013-04-26?10:32??GMapClient\bin\Debug\ColorProcess.exe.config
?????文件??????17920??2013-04-26?10:33??GMapClient\bin\Debug\ColorProcess.pdb
?????文件??????37888??2013-04-26?16:44??GMapClient\bin\Debug\GMapClient.exe
?????文件????????144??2013-04-26?10:32??GMapClient\bin\Debug\GMapClient.exe.config
?????文件??????71168??2013-04-26?16:44??GMapClient\bin\Debug\GMapClient.pdb
?????文件??????11592??2013-05-14?10:40??GMapClient\bin\Debug\GMapClient.vshost.exe
?????文件????????144??2013-04-26?10:32??GMapClient\bin\Debug\GMapClient.vshost.exe.config
?????文件????????490??2010-03-17?22:39??GMapClient\bin\Debug\GMapClient.vshost.exe.manifest
?????文件??????24576??2008-09-17?11:38??GMapClient\bin\Debug\ImageQuantization.dll
?????文件??????38400??2008-09-17?11:38??GMapClient\bin\Debug\ImageQuantization.pdb
?????文件????????110??2008-10-16?14:18??GMapClient\bin\Debug\k.gif
?????文件??????37376??2013-04-26?16:44??GMapClient\bin\Debug\MapLib.dll
?????文件?????173568??2013-04-26?16:44??GMapClient\bin\Debug\MapLib.pdb
?????文件????????160??2008-10-09?20:55??GMapClient\bin\Debug\vssver.scc
?????文件??????94938??2008-10-31?18:05??GMapClient\bin\Debug.rar
?????文件???????2420??2008-10-30?09:59??GMapClient\FileOpreator\CountSizeAndSingleColor.cs
?????文件???????1699??2008-10-31?17:06??GMapClient\FileOpreator\FileProcessMake.cs
?????文件??????20243??2013-04-26?11:30??GMapClient\Form1.cs
?????文件??????54765??2013-04-26?11:24??GMapClient\Form1.Designer.cs
?????文件???????6437??2013-04-26?11:24??GMapClient\Form1.resx
?????文件???????5580??2013-04-26?10:32??GMapClient\GMapClient.csproj
?????文件????????452??2013-04-26?10:32??GMapClient\GMapClient.csproj.user
?????文件???????5847??2013-04-26?16:44??GMapClient\obj\Debug\DesignTimeResolveAssemblyReferencesInput.cache
?????文件????????204??2013-04-26?11:24??GMapClient\obj\Debug\GenerateResource.read.1.tlog
?????文件????????502??2013-04-26?11:24??GMapClient\obj\Debug\GenerateResource.write.1.tlog
?????文件???????3674??2013-05-14?10:40??GMapClient\obj\Debug\GMapClient.csproj.FileListAbsolute.txt
?????文件????????847??2008-10-31?17:34??GMapClient\obj\Debug\GMapClient.csproj.GenerateResource.Cache
?????文件??????37888??2013-04-26?16:44??GMapClient\obj\Debug\GMapClient.exe
............此處省略577個文件信息
- 上一篇:教學事務管理系統.
- 下一篇:COMSOL_PDE_學習資料
評論
共有 條評論