Commit 43843203 authored by nanahira's avatar nanahira

Removed thumbnail

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