|
@@ -417,28 +417,28 @@ namespace Common.system
|
417
|
417
|
{
|
418
|
418
|
MemoryStream memoryStream = new MemoryStream();
|
419
|
419
|
encoder.Save(memoryStream);
|
420
|
|
- //System.Drawing.Image img = System.Drawing.Image.FromStream(memoryStream);
|
421
|
|
- Bitmap bit = new Bitmap(memoryStream);
|
422
|
|
- if (ImgWidth - 2 < bit.Width)
|
|
420
|
+ new Thread(new ThreadStart(new Action(() =>
|
423
|
421
|
{
|
424
|
|
- try
|
|
422
|
+ //System.Drawing.Image img = System.Drawing.Image.FromStream(memoryStream);
|
|
423
|
+ Bitmap bit = new Bitmap(memoryStream);
|
|
424
|
+ if (ImgWidth - 2 < bit.Width)
|
425
|
425
|
{
|
426
|
|
- Graphics g = Graphics.FromImage(Img);
|
427
|
|
- //g.InterpolationMode = InterpolationMode.HighQualityBicubic;
|
428
|
|
- g.DrawImage(bit, new Rectangle(0, 0, ImgWidth, ImgHeight), new Rectangle(0, 0, bit.Width, bit.Height), GraphicsUnit.Pixel);
|
429
|
|
- g.Dispose();
|
|
426
|
+ try
|
|
427
|
+ {
|
|
428
|
+ Graphics g = Graphics.FromImage(Img);
|
|
429
|
+ //g.InterpolationMode = InterpolationMode.HighQualityBicubic;
|
|
430
|
+ g.DrawImage(bit, new Rectangle(0, 0, ImgWidth, ImgHeight), new Rectangle(0, 0, bit.Width, bit.Height), GraphicsUnit.Pixel);
|
|
431
|
+ g.Dispose();
|
|
432
|
+ }
|
|
433
|
+ catch
|
|
434
|
+ {
|
|
435
|
+ Img = bit;
|
|
436
|
+ }
|
430
|
437
|
}
|
431
|
|
- catch
|
|
438
|
+ else
|
432
|
439
|
{
|
433
|
440
|
Img = bit;
|
434
|
441
|
}
|
435
|
|
- }
|
436
|
|
- else
|
437
|
|
- {
|
438
|
|
- Img = bit;
|
439
|
|
- }
|
440
|
|
- new Thread(new ThreadStart(new Action(() =>
|
441
|
|
- {
|
442
|
442
|
Img.Save(filePathName);
|
443
|
443
|
//Bitmap bitmap = CutImageWhitePart(Img);
|
444
|
444
|
//FileToolsCommon.DeleteFile(filePathName);
|