public static Bitmap Setjpg(string gpath, bool yulan, int id, int leng) { string jpgfile = gpath + "pics\\" + id.ToString() + ".jpg"; if (File.Exists(jpgfile)) { if (yulan == true) { if (CDB.cards.ContainsKey(id)) { return(PIC.CutJPG(gpath, id, CDB.cards[id].type, leng, leng)); } } else { return(PIC.GetBitmap(jpgfile)); } } else { jpgfile = "./data/Images/cover.jpg"; if (File.Exists(jpgfile)) { return(PIC.GetBitmap(jpgfile)); } } return(null); }
private void Cut() { a = 0; foreach (int id in CDB.cards.Keys) { if (stop == false) { a++; PIC.CutJPG(path1, id, CDB.cards[id].type, path2, SET.Length, SET.Length); progressBar1.Invoke(pb1); label1.Invoke(lb1); } else { break; } } if (stop == true) { MessageBox.Show("已经取消!"); } else { stop = true; MessageBox.Show("裁剪完成。\n文件在" + path2); } this.Invoke(fm); }