Commit 43843203 authored by nanahira's avatar nanahira

Removed thumbnail

parent 86774817
...@@ -40,10 +40,10 @@ public string GetImage(long id) ...@@ -40,10 +40,10 @@ public string GetImage(long id)
{ {
return GetImage(id.ToString()); return GetImage(id.ToString());
} }
public string GetImageThum(long id) //public string GetImageThum(long id)
{ //{
return GetImageThum(id.ToString()); // return GetImageThum(id.ToString());
} //}
public string GetImageField(long id) public string GetImageField(long id)
{ {
return GetImageField(id.ToString());//场地图 return GetImageField(id.ToString());//场地图
...@@ -61,10 +61,10 @@ public string GetImage(string id) ...@@ -61,10 +61,10 @@ public string GetImage(string id)
{ {
return MyPath.Combine(picpath, id + ".jpg"); return MyPath.Combine(picpath, id + ".jpg");
} }
public string GetImageThum(string id) //public string GetImageThum(string id)
{ //{
return MyPath.Combine(picpath2, id + ".jpg"); // return MyPath.Combine(picpath2, id + ".jpg");
} //}
public string GetImageField(string id) public string GetImageField(string id)
{ {
return MyPath.Combine(fieldpath, id+ ".png");//场地图 return MyPath.Combine(fieldpath, id+ ".png");//场地图
...@@ -82,7 +82,7 @@ public string[] GetCardfiles(long id) ...@@ -82,7 +82,7 @@ public string[] GetCardfiles(long id)
{ {
string[] files = new string[]{ string[] files = new string[]{
GetImage(id),//大图 GetImage(id),//大图
GetImageThum(id),//小图 //GetImageThum(id),//小图
GetImageField(id),//场地图 GetImageField(id),//场地图
GetScript(id) GetScript(id)
}; };
...@@ -92,7 +92,7 @@ public string[] GetCardfiles(string id) ...@@ -92,7 +92,7 @@ public string[] GetCardfiles(string id)
{ {
string[] files = new string[]{ string[] files = new string[]{
GetImage(id),//大图 GetImage(id),//大图
GetImageThum(id),//小图 //GetImageThum(id),//小图
GetImageField(id),//场地图 GetImageField(id),//场地图
GetScript(id) GetScript(id)
}; };
......
...@@ -116,15 +116,16 @@ public void SetTask(MyTask myTask, Card[] cards, params string[] args) ...@@ -116,15 +116,16 @@ public void SetTask(MyTask myTask, Card[] cards, params string[] args)
mArgs = args; mArgs = args;
} }
//转换图片 //转换图片
public void ToImg(string img, string saveimg1, string saveimg2) //public void ToImg(string img, string saveimg1, string saveimg2)
public void ToImg(string img, string saveimg1)
{ {
if (!File.Exists(img)) if (!File.Exists(img))
return; return;
Bitmap bmp = new Bitmap(img); Bitmap bmp = new Bitmap(img);
MyBitmap.SaveAsJPEG(MyBitmap.Zoom(bmp, imgSet.W, imgSet.H), MyBitmap.SaveAsJPEG(MyBitmap.Zoom(bmp, imgSet.W, imgSet.H),
saveimg1, imgSet.quilty); saveimg1, imgSet.quilty);
MyBitmap.SaveAsJPEG(MyBitmap.Zoom(bmp, imgSet.w, imgSet.h), //MyBitmap.SaveAsJPEG(MyBitmap.Zoom(bmp, imgSet.w, imgSet.h),
saveimg2, imgSet.quilty); // saveimg2, imgSet.quilty);
bmp.Dispose(); bmp.Dispose();
} }
#endregion #endregion
...@@ -203,11 +204,12 @@ public void CutImages(string imgpath, bool isreplace) ...@@ -203,11 +204,12 @@ public void CutImages(string imgpath, bool isreplace)
} }
#endregion #endregion
//removed thumbnail
#region 转换图片 #region 转换图片
public void ConvertImages(string imgpath, string gamepath, bool isreplace) public void ConvertImages(string imgpath, string gamepath, bool isreplace)
{ {
string picspath = MyPath.Combine(gamepath, "pics"); string picspath = MyPath.Combine(gamepath, "pics");
string thubpath = MyPath.Combine(picspath, "thumbnail"); //string thubpath = MyPath.Combine(picspath, "thumbnail");
string[] files = Directory.GetFiles(imgpath); string[] files = Directory.GetFiles(imgpath);
int i = 0; int i = 0;
int count = files.Length; int count = files.Length;
...@@ -221,7 +223,7 @@ public void ConvertImages(string imgpath, string gamepath, bool isreplace) ...@@ -221,7 +223,7 @@ public void ConvertImages(string imgpath, string gamepath, bool isreplace)
string ex = Path.GetExtension(f).ToLower(); string ex = Path.GetExtension(f).ToLower();
string name = Path.GetFileNameWithoutExtension(f); string name = Path.GetFileNameWithoutExtension(f);
string jpg_b = MyPath.Combine(picspath, name + ".jpg"); string jpg_b = MyPath.Combine(picspath, name + ".jpg");
string jpg_s = MyPath.Combine(thubpath, name + ".jpg"); //string jpg_s = MyPath.Combine(thubpath, name + ".jpg");
if (ex == ".jpg" || ex == ".png" || ex == ".bmp") if (ex == ".jpg" || ex == ".png" || ex == ".bmp")
{ {
if (File.Exists(f)) if (File.Exists(f))
...@@ -235,12 +237,12 @@ public void ConvertImages(string imgpath, string gamepath, bool isreplace) ...@@ -235,12 +237,12 @@ public void ConvertImages(string imgpath, string gamepath, bool isreplace)
jpg_b, imgSet.quilty); jpg_b, imgSet.quilty);
} }
//小图,如果替换,或者不存在 //小图,如果替换,或者不存在
if (isreplace || !File.Exists(jpg_s)) //if (isreplace || !File.Exists(jpg_s))
{ //{
MyBitmap.SaveAsJPEG(MyBitmap.Zoom(bmp, imgSet.w, imgSet.h), // MyBitmap.SaveAsJPEG(MyBitmap.Zoom(bmp, imgSet.w, imgSet.h),
jpg_s, imgSet.quilty); // jpg_s, imgSet.quilty);
} //}
} }
} }
} }
......
...@@ -1316,8 +1316,9 @@ void ImportImage(string file, string tid) ...@@ -1316,8 +1316,9 @@ void ImportImage(string file, string tid)
} }
else else
{ {
tasker.ToImg(file, ygopath.GetImage(tid), // tasker.ToImg(file, ygopath.GetImage(tid),
ygopath.GetImageThum(tid)); // ygopath.GetImageThum(tid));
tasker.ToImg(file, ygopath.GetImage(tid));
} }
SetImage(tid); SetImage(tid);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment