Removed comment
This commit is contained in:
parent
c722d39eb1
commit
a076f6b8fb
1 changed files with 0 additions and 234 deletions
|
|
@ -215,240 +215,6 @@ public class ImageCreatorSharp(PicSettings picSettings, ILogger<ImageCreatorShar
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// private void CreaMiniature(Image g, ImageState imgState, Bitmap imgOutputBig, ImageFormat thisFormat)
|
|
||||||
// {
|
|
||||||
// if (!picSettings.CreaMiniature || picSettings.AggiungiScritteMiniature)
|
|
||||||
// return;
|
|
||||||
//
|
|
||||||
// if (picSettings.TestoMin)
|
|
||||||
// imgState.TestoFirmaPiccola = imgState.NomeFileBig;
|
|
||||||
// else if (picSettings.AggNumTempMin)
|
|
||||||
// imgState.TestoFirmaPiccola = imgState.NomeFileBig + " ";
|
|
||||||
//
|
|
||||||
// Font crFont1 = null;
|
|
||||||
// Font crFont2 = null;
|
|
||||||
// var crSize1 = new SizeF();
|
|
||||||
// var crSize2 = new SizeF();
|
|
||||||
//
|
|
||||||
//
|
|
||||||
// if (string.Equals(picSettings.DirectorySorgente, picSettings.DirectoryDestinazione,
|
|
||||||
// StringComparison.OrdinalIgnoreCase))
|
|
||||||
// imgState.NomeFileSmall = imgState.NomeFileSmall.Substring(0, imgState.NomeFileSmall.Length - 4) +
|
|
||||||
// picSettings.Codice +
|
|
||||||
// imgState.NomeFileSmall.Substring(imgState.NomeFileSmall.Length - 4);
|
|
||||||
//
|
|
||||||
// if (picSettings.UsaOrarioMiniatura | picSettings.TestoMin | picSettings.AggTempoGaraMin |
|
|
||||||
// picSettings.AggNumTempMin)
|
|
||||||
// {
|
|
||||||
// if (imgState.TestoFirmaPiccola.Length > 0)
|
|
||||||
// {
|
|
||||||
// using var imgOutputSmall = (Bitmap)imgOutputBig.Clone();
|
|
||||||
// using var grPhoto1 = Graphics.FromImage(imgOutputSmall);
|
|
||||||
// grPhoto1.SmoothingMode = SmoothingMode.AntiAlias;
|
|
||||||
//
|
|
||||||
// // quick fix
|
|
||||||
// imgState.DimensioneStandardMiniatura = 50;
|
|
||||||
// if (picSettings.Grassetto == true)
|
|
||||||
// {
|
|
||||||
// crFont1 = new Font(picSettings.IlFont, imgState.DimensioneStandardMiniatura,
|
|
||||||
// FontStyle.Bold);
|
|
||||||
// crFont2 = new Font(picSettings.IlFont, imgState.DimensioneStandard, FontStyle.Bold);
|
|
||||||
// }
|
|
||||||
// else
|
|
||||||
// {
|
|
||||||
// crFont1 = new Font(picSettings.IlFont, imgState.DimensioneStandardMiniatura);
|
|
||||||
// crFont2 = new Font(picSettings.IlFont, imgState.DimensioneStandard);
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// crSize1 = grPhoto1.MeasureString(imgState.TestoFirmaPiccola, crFont1);
|
|
||||||
// crSize2 = grPhoto1.MeasureString(imgState.TestoFirma, crFont1);
|
|
||||||
// var larghezzaStandard1 = System.Convert.ToInt32(crSize1.Width);
|
|
||||||
//
|
|
||||||
// if (crSize1.Width > System.Convert.ToSingle(g.Width))
|
|
||||||
// {
|
|
||||||
// int Conta = imgState.DimensioneStandardMiniatura;
|
|
||||||
// do
|
|
||||||
// {
|
|
||||||
// if (Conta > 20)
|
|
||||||
// Conta -= 5;
|
|
||||||
// else
|
|
||||||
// Conta -= 1;
|
|
||||||
// if (picSettings.Grassetto == true)
|
|
||||||
// crFont1 = new Font(picSettings.IlFont, Conta, FontStyle.Bold);
|
|
||||||
// else
|
|
||||||
// crFont1 = new Font(picSettings.IlFont, Conta);
|
|
||||||
// crSize1 = grPhoto1.MeasureString(imgState.TestoFirmaPiccola, crFont1);
|
|
||||||
// if (crSize1.Width < System.Convert.ToSingle(g.Width))
|
|
||||||
// {
|
|
||||||
// larghezzaStandard1 = System.Convert.ToInt32(crSize1.Width);
|
|
||||||
// break;
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// if (Conta <= 5)
|
|
||||||
// break;
|
|
||||||
// } while (true);
|
|
||||||
//
|
|
||||||
// imgState.DimensioneStandardMiniatura = Conta;
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// switch (picSettings.Posizione.ToUpper())
|
|
||||||
// {
|
|
||||||
// case "ALTO":
|
|
||||||
// {
|
|
||||||
// imgState.YPosFromBottom1 = (picSettings.Margine);
|
|
||||||
// imgState.YPosFromBottom4 = (picSettings.MargVert);
|
|
||||||
// break;
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// case "BASSO":
|
|
||||||
// {
|
|
||||||
// imgState.YPosFromBottom1 = System.Convert.ToSingle((g.Height - crSize1.Height -
|
|
||||||
// (g.Height * picSettings.Margine /
|
|
||||||
// (double)100)));
|
|
||||||
// imgState.YPosFromBottom4 = System.Convert.ToSingle((g.Height - crSize1.Height -
|
|
||||||
// (g.Height * picSettings.MargVert /
|
|
||||||
// (double)100)));
|
|
||||||
// break;
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// float xCenterOfImg1 = 0;
|
|
||||||
//
|
|
||||||
// using StringFormat strFormat1 = new StringFormat();
|
|
||||||
// switch (picSettings.Allineamento.ToUpper())
|
|
||||||
// {
|
|
||||||
// case "SINISTRA":
|
|
||||||
// {
|
|
||||||
// xCenterOfImg1 =
|
|
||||||
// System.Convert.ToSingle((picSettings.Margine + (larghezzaStandard1 / (double)2)));
|
|
||||||
//
|
|
||||||
// if ((larghezzaStandard1 / (double)2) > (g.Width / (double)2) - picSettings.Margine)
|
|
||||||
// xCenterOfImg1 = System.Convert.ToSingle((g.Width / (double)2));
|
|
||||||
// break;
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// case "CENTRO":
|
|
||||||
// {
|
|
||||||
// xCenterOfImg1 = System.Convert.ToSingle((g.Width / (double)2));
|
|
||||||
// break;
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// case "DESTRA":
|
|
||||||
// {
|
|
||||||
// xCenterOfImg1 = System.Convert.ToSingle((g.Width - picSettings.Margine -
|
|
||||||
// (larghezzaStandard1 / (double)2)));
|
|
||||||
//
|
|
||||||
// if ((larghezzaStandard1 / (double)2) > (g.Width / (double)2) - picSettings.Margine)
|
|
||||||
// xCenterOfImg1 = System.Convert.ToSingle((g.Width / (double)2));
|
|
||||||
// break;
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// strFormat1.Alignment = StringAlignment.Center;
|
|
||||||
//
|
|
||||||
// using var semiTransBrush21 = new SolidBrush(Color.FromArgb(imgState.AlphaScelta, 0, 0, 0));
|
|
||||||
// using var semiTransBrush1 =
|
|
||||||
// new SolidBrush(Color.FromArgb(imgState.AlphaScelta, picSettings.FontColoreRGB));
|
|
||||||
//
|
|
||||||
// // quick fix
|
|
||||||
// imgState.DimensioneStandardMiniatura = picSettings.DimMin;
|
|
||||||
//
|
|
||||||
// if (picSettings.Grassetto == true)
|
|
||||||
// crFont1 = new Font(picSettings.IlFont, imgState.DimensioneStandardMiniatura,
|
|
||||||
// FontStyle.Bold);
|
|
||||||
// else
|
|
||||||
// crFont1 = new Font(picSettings.IlFont, imgState.DimensioneStandardMiniatura);
|
|
||||||
//
|
|
||||||
// if (picSettings.TestoMin)
|
|
||||||
// {
|
|
||||||
// grPhoto1.DrawString(imgState.NomeFileBig, crFont1, semiTransBrush21,
|
|
||||||
// new PointF(xCenterOfImg1 + 1, imgState.YPosFromBottom1 + 1), strFormat1);
|
|
||||||
// grPhoto1.DrawString(imgState.NomeFileBig, crFont1, semiTransBrush1,
|
|
||||||
// new PointF(xCenterOfImg1, imgState.YPosFromBottom1), strFormat1);
|
|
||||||
// }
|
|
||||||
// else if (picSettings.AggTempoGaraMin & picSettings.UsaTempoGaraTestoApplicare)
|
|
||||||
// {
|
|
||||||
// var diff = imgState.DataPartenzaI - imgState.DataFoto;
|
|
||||||
// var diffA = diff.TotalSeconds * 10000000;
|
|
||||||
//
|
|
||||||
// var orario =
|
|
||||||
// new TimeSpan(0, 0,
|
|
||||||
// (int)diffA); /* new TimeSpan(DateTime.DateDiff(DateInterval.Second, dataPartenzaI, dataFoto) * 10000000);*/
|
|
||||||
// string tempstr = "";
|
|
||||||
//
|
|
||||||
//
|
|
||||||
// tempstr += Environment.NewLine + imgState.TestoOrario + orario.Hours.ToString("00") + ":" +
|
|
||||||
// orario.Minutes.ToString("00") + ":" + orario.Seconds.ToString("00");
|
|
||||||
//
|
|
||||||
//
|
|
||||||
// grPhoto1.DrawString(tempstr, crFont1, semiTransBrush21,
|
|
||||||
// new PointF(xCenterOfImg1 + 1, imgState.YPosFromBottom1 + 1), strFormat1);
|
|
||||||
// grPhoto1.DrawString(tempstr, crFont1, semiTransBrush1,
|
|
||||||
// new PointF(xCenterOfImg1, imgState.YPosFromBottom1), strFormat1);
|
|
||||||
// }
|
|
||||||
// else if (picSettings.AggNumTempMin)
|
|
||||||
// {
|
|
||||||
// var diff = imgState.DataPartenzaI - imgState.DataFoto;
|
|
||||||
// var diffA = diff.TotalSeconds * 10000000;
|
|
||||||
// TimeSpan Orario = new TimeSpan(0, 0, (int)diffA);
|
|
||||||
// string tempstr = "";
|
|
||||||
// tempstr += imgState.NomeFileBig;
|
|
||||||
//
|
|
||||||
// tempstr += Environment.NewLine + imgState.TestoOrario + Orario.Hours.ToString("00") + ":" +
|
|
||||||
// Orario.Minutes.ToString("00") + ":" + Orario.Seconds.ToString("00");
|
|
||||||
//
|
|
||||||
//
|
|
||||||
// grPhoto1.DrawString(tempstr, crFont1, semiTransBrush21,
|
|
||||||
// new PointF(xCenterOfImg1 + 1, imgState.YPosFromBottom1 + 1), strFormat1);
|
|
||||||
// grPhoto1.DrawString(tempstr, crFont1, semiTransBrush1,
|
|
||||||
// new PointF(xCenterOfImg1, imgState.YPosFromBottom1), strFormat1);
|
|
||||||
// }
|
|
||||||
// else
|
|
||||||
// {
|
|
||||||
// grPhoto1.DrawString(imgState.TestoFirmaPiccola, crFont1, semiTransBrush21,
|
|
||||||
// new PointF(xCenterOfImg1 + 1, imgState.YPosFromBottom1 + 1), strFormat1);
|
|
||||||
// grPhoto1.DrawString(imgState.TestoFirmaPiccola, crFont1, semiTransBrush1,
|
|
||||||
// new PointF(xCenterOfImg1, imgState.YPosFromBottom1), strFormat1);
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// // Salva la miniatura
|
|
||||||
// //using (var g22 = Image.FromHbitmap(imgOutputSmall))
|
|
||||||
//
|
|
||||||
//
|
|
||||||
// using var imgOutputSmall2 = new Bitmap(imgOutputSmall, imgState.ThumbSizeSmall.Width,
|
|
||||||
// imgState.ThumbSizeSmall.Height);
|
|
||||||
// imgOutputSmall2.Save(Path.Combine(imgState.DestDir.FullName, imgState.NomeFileSmall),
|
|
||||||
// thisFormat);
|
|
||||||
//
|
|
||||||
// //imgOutputSmall2.Dispose();
|
|
||||||
//
|
|
||||||
// //imgOutputSmall.Dispose();
|
|
||||||
//
|
|
||||||
//
|
|
||||||
// //File.Delete(Path.Combine(DestDir.FullName, "Temp_" + nomeFileSmall));
|
|
||||||
// //FileSystem.Kill();
|
|
||||||
// }
|
|
||||||
// else
|
|
||||||
// {
|
|
||||||
// using var imgOutputSmall = new Bitmap(g, imgState.ThumbSizeSmall.Width,
|
|
||||||
// imgState.ThumbSizeSmall.Height);
|
|
||||||
// imgOutputSmall.Save(Path.Combine(imgState.DestDir.FullName, imgState.NomeFileSmall),
|
|
||||||
// thisFormat);
|
|
||||||
// //imgOutputSmall.Dispose();
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// else
|
|
||||||
// {
|
|
||||||
// using var imgOutputSmall =
|
|
||||||
// new Bitmap(g, imgState.ThumbSizeSmall.Width, imgState.ThumbSizeSmall.Height);
|
|
||||||
// imgOutputSmall.Save(Path.Combine(imgState.DestDir.FullName, imgState.NomeFileSmall), thisFormat);
|
|
||||||
// //imgOutputSmall.Dispose();
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// crFont1?.Dispose();
|
|
||||||
// crFont2?.Dispose();
|
|
||||||
// }
|
|
||||||
|
|
||||||
private void CreaMiniature(Image sourceImage, ImageState imgState, Bitmap imgOutputBig, ImageFormat format)
|
private void CreaMiniature(Image sourceImage, ImageState imgState, Bitmap imgOutputBig, ImageFormat format)
|
||||||
{
|
{
|
||||||
if (!picSettings.CreaMiniature || picSettings.AggiungiScritteMiniature)
|
if (!picSettings.CreaMiniature || picSettings.AggiungiScritteMiniature)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue