From a076f6b8fb2ae1f9e284334efcbc36a985b080f0 Mon Sep 17 00:00:00 2001 From: MaddoScientisto Date: Wed, 4 Feb 2026 17:53:01 +0100 Subject: [PATCH] Removed comment --- MaddoShared/ImageCreatorSharp.cs | 234 ------------------------------- 1 file changed, 234 deletions(-) diff --git a/MaddoShared/ImageCreatorSharp.cs b/MaddoShared/ImageCreatorSharp.cs index e989984..f535a4e 100644 --- a/MaddoShared/ImageCreatorSharp.cs +++ b/MaddoShared/ImageCreatorSharp.cs @@ -215,240 +215,6 @@ public class ImageCreatorSharp(PicSettings picSettings, ILogger 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) { if (!picSettings.CreaMiniature || picSettings.AggiungiScritteMiniature)