ayy
This commit is contained in:
parent
6bf75551e3
commit
8111f8dfc5
4 changed files with 184 additions and 98 deletions
|
|
@ -1,5 +1,5 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||||
|
|
@ -9,12 +9,13 @@
|
||||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||||
<RootNamespace>CatalogLib</RootNamespace>
|
<RootNamespace>CatalogLib</RootNamespace>
|
||||||
<AssemblyName>CatalogLib</AssemblyName>
|
<AssemblyName>CatalogLib</AssemblyName>
|
||||||
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
|
<TargetFrameworkVersion>v4.6</TargetFrameworkVersion>
|
||||||
<FileAlignment>512</FileAlignment>
|
<FileAlignment>512</FileAlignment>
|
||||||
<SccProjectName>SAK</SccProjectName>
|
<SccProjectName>SAK</SccProjectName>
|
||||||
<SccLocalPath>SAK</SccLocalPath>
|
<SccLocalPath>SAK</SccLocalPath>
|
||||||
<SccAuxPath>SAK</SccAuxPath>
|
<SccAuxPath>SAK</SccAuxPath>
|
||||||
<SccProvider>SAK</SccProvider>
|
<SccProvider>SAK</SccProvider>
|
||||||
|
<TargetFrameworkProfile />
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||||
<DebugSymbols>true</DebugSymbols>
|
<DebugSymbols>true</DebugSymbols>
|
||||||
|
|
@ -48,6 +49,7 @@
|
||||||
<Compile Include="ImageCreator.cs" />
|
<Compile Include="ImageCreator.cs" />
|
||||||
<Compile Include="PicSettings.cs" />
|
<Compile Include="PicSettings.cs" />
|
||||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||||
|
<Compile Include="SinglePicData.cs" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ProjectReference Include="..\CatalogVbLib\CatalogVbLib.vbproj">
|
<ProjectReference Include="..\CatalogVbLib\CatalogVbLib.vbproj">
|
||||||
|
|
|
||||||
|
|
@ -14,12 +14,16 @@ namespace CatalogLib
|
||||||
public class ImageCreator
|
public class ImageCreator
|
||||||
{
|
{
|
||||||
|
|
||||||
#region "dichiarazioni"
|
#region Variabili
|
||||||
|
|
||||||
|
private SinglePicData _singlePicData;
|
||||||
|
private PicSettings _picSettings;
|
||||||
|
|
||||||
private bool FotoRuotaADestra = false;
|
private Rotazione _rotation;
|
||||||
|
|
||||||
private bool FotoRuotaASinistra = false;
|
//private bool FotoRuotaADestra = false;
|
||||||
|
|
||||||
|
//private bool FotoRuotaASinistra = false;
|
||||||
private string TempMinText = "";
|
private string TempMinText = "";
|
||||||
//Private crFont1 As Font
|
//Private crFont1 As Font
|
||||||
|
|
||||||
|
|
@ -83,56 +87,87 @@ namespace CatalogLib
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
public ImageCreator(string nomeFileChild, DirectoryInfo sourceDir, DirectoryInfo destDir, DirectoryInfo destDirStart)
|
//public ImageCreator(string nomeFileChild, DirectoryInfo sourceDir, DirectoryInfo destDir, DirectoryInfo destDirStart)
|
||||||
|
//{
|
||||||
|
// this.NomeFileChild = nomeFileChild;
|
||||||
|
// SourceDir = sourceDir;
|
||||||
|
// DestDir = destDir;
|
||||||
|
// DestDirStart = destDirStart;
|
||||||
|
// WorkFile = new FileInfo(nomeFileChild);
|
||||||
|
//}
|
||||||
|
|
||||||
|
//public ImageCreator(string nomeFileChild, DirectoryInfo sourceDir, DirectoryInfo destDir)
|
||||||
|
//{
|
||||||
|
// NomeFileChild = nomeFileChild;
|
||||||
|
// DestDir = destDir;
|
||||||
|
//}
|
||||||
|
|
||||||
|
//public ImageCreator(FileInfo file, DirectoryInfo destination)
|
||||||
|
//{
|
||||||
|
// WorkFile = file;
|
||||||
|
// DestDir = destination;
|
||||||
|
//}
|
||||||
|
|
||||||
|
public ImageCreator(SinglePicData picData, PicSettings picSettings)
|
||||||
{
|
{
|
||||||
this.NomeFileChild = nomeFileChild;
|
|
||||||
SourceDir = sourceDir;
|
|
||||||
DestDir = destDir;
|
|
||||||
DestDirStart = destDirStart;
|
|
||||||
WorkFile = new FileInfo(nomeFileChild);
|
|
||||||
}
|
|
||||||
|
|
||||||
public ImageCreator(string nomeFileChild, DirectoryInfo sourceDir, DirectoryInfo destDir)
|
|
||||||
{
|
|
||||||
NomeFileChild = nomeFileChild;
|
|
||||||
DestDir = destDir;
|
|
||||||
}
|
|
||||||
|
|
||||||
public ImageCreator(FileInfo file, DirectoryInfo destination)
|
|
||||||
{
|
|
||||||
WorkFile = file;
|
|
||||||
DestDir = destination;
|
|
||||||
}
|
|
||||||
|
|
||||||
public StringDigitSubstitute CreaImmagineThread(string info)
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Elabora l'immagine
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="info">Non ne ho idea. ToDo: capire a che serve</param>
|
||||||
public void CreaImmagineThread(string info)
|
public void CreaImmagineThread(string info)
|
||||||
{
|
{
|
||||||
|
|
||||||
CatalogLib.PicSettings ps = new CatalogLib.PicSettings();
|
//CatalogLib.PicSettings ps = new CatalogLib.PicSettings();
|
||||||
|
|
||||||
|
PreparaVariabili();
|
||||||
|
|
||||||
|
// Workfile deve essere impostato esternamente. ToDo: passarlo come parametro così da potere riutilizzare la classe senza eliminarla e ricrearla
|
||||||
Image g = Image.FromFile(WorkFile.FullName);
|
Image g = Image.FromFile(WorkFile.FullName);
|
||||||
|
|
||||||
|
ImpostaTestoExtra(g);
|
||||||
|
|
||||||
|
// Rotazione immagine in base ai dati EXIF
|
||||||
|
Rotation(ref g);
|
||||||
|
|
||||||
if (ps.CreaMiniature)
|
// Impostazione del formato
|
||||||
|
// todo: mettere una selezione più specifica invece di assumere jpg
|
||||||
|
ImageFormat currentFormat = g.RawFormat;
|
||||||
|
if (_picSettings.UsaForzaJpg)
|
||||||
{
|
{
|
||||||
CreaMiniature();
|
currentFormat = ImageFormat.Jpeg;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
PrepareThumbnailSize(g);
|
||||||
|
|
||||||
|
// big image resolution
|
||||||
|
var imgOutputBig = new Bitmap(g, thumbSizeBig.Width, thumbSizeBig.Height);
|
||||||
|
imgOutputBig.SetResolution(g.HorizontalResolution, g.VerticalResolution);
|
||||||
|
|
||||||
|
|
||||||
|
if (_picSettings.CreaMiniature)
|
||||||
|
{
|
||||||
|
|
||||||
|
CreaMiniature(g, imgOutputBig, currentFormat);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private void Rotation(ref System.Drawing.Image g)
|
private void Rotation(ref System.Drawing.Image g)
|
||||||
{
|
{
|
||||||
FotoRuotaADestra = false;
|
//FotoRuotaADestra = false;
|
||||||
FotoRuotaASinistra = false;
|
//FotoRuotaASinistra = false;
|
||||||
|
_rotation = Rotazione.Normale;
|
||||||
|
|
||||||
if (CatalogVbLib.PicSettings.UsaRotazioneAutomatica == true)
|
if (_picSettings.UsaRotazioneAutomatica)
|
||||||
{
|
{
|
||||||
// ci sono dati exif
|
// ci sono dati exif
|
||||||
if (g.PropertyIdList.Length > 0)
|
if (g.PropertyIdList.Length > 0)
|
||||||
|
|
@ -151,7 +186,8 @@ namespace CatalogLib
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case ExifReader.Orientations.LftBottom:
|
case ExifReader.Orientations.LftBottom:
|
||||||
FotoRuotaASinistra = true;
|
//FotoRuotaASinistra = true;
|
||||||
|
_rotation = Rotazione.Sinistra;
|
||||||
break;
|
break;
|
||||||
case ExifReader.Orientations.RightBottom:
|
case ExifReader.Orientations.RightBottom:
|
||||||
|
|
||||||
|
|
@ -169,68 +205,80 @@ namespace CatalogLib
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (FotoRuotaASinistra == true)
|
if (_rotation == Rotazione.Sinistra)
|
||||||
{
|
{
|
||||||
g.RotateFlip(RotateFlipType.Rotate270FlipNone);
|
g.RotateFlip(RotateFlipType.Rotate270FlipNone);
|
||||||
}
|
}else
|
||||||
if (FotoRuotaADestra == true)
|
if (_rotation == Rotazione.Destra)
|
||||||
{
|
{
|
||||||
g.RotateFlip(RotateFlipType.Rotate90FlipNone);
|
g.RotateFlip(RotateFlipType.Rotate90FlipNone);
|
||||||
}
|
}
|
||||||
|
// todo: capire quando va ruotato a destra
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Aggiunge orario e tempo gara
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="g"></param>
|
||||||
private void ImpostaTestoExtra(Image g)
|
private void ImpostaTestoExtra(Image g)
|
||||||
{
|
{
|
||||||
if (CatalogVbLib.PicSettings.UsaOrarioTestoApplicare ||
|
if (_picSettings.UsaOrarioTestoApplicare ||
|
||||||
CatalogVbLib.PicSettings.UsaTempoGaraTestoApplicare ||
|
_picSettings.UsaTempoGaraTestoApplicare ||
|
||||||
CatalogVbLib.PicSettings.UsaOrarioMiniatura ||
|
_picSettings.UsaOrarioMiniatura ||
|
||||||
CatalogVbLib.PicSettings.TestoMin ||
|
_picSettings.TestoMin ||
|
||||||
CatalogVbLib.PicSettings.AggTempoGaraMin ||
|
_picSettings.AggTempoGaraMin ||
|
||||||
CatalogVbLib.PicSettings.AggNumTempMin)
|
_picSettings.AggNumTempMin)
|
||||||
{
|
{
|
||||||
if (g.PropertyIdList.Length > 0) //ci sono dati exif
|
if (g.PropertyIdList.Length > 0) //ci sono dati exif
|
||||||
{
|
{
|
||||||
var datiExix = new ExifReader((Bitmap)g);
|
var datiExix = new ExifReader((Bitmap)g);
|
||||||
dataFoto = datiExix.DateTimeOriginal;
|
dataFoto = datiExix.DateTimeOriginal;
|
||||||
testoFirma = CatalogVbLib.PicSettings.TestoFirmaStart;
|
testoFirma = _picSettings.TestoFirmaStart;
|
||||||
testoFirmaV = CatalogVbLib.PicSettings.TestoFirmaStartV;
|
testoFirmaV = _picSettings.TestoFirmaStartV;
|
||||||
|
|
||||||
if (dataFoto.Year != 1)
|
if (dataFoto.Year != 1)
|
||||||
{
|
{
|
||||||
testoFirmaPiccola = dataFoto.ToShortDateString();
|
testoFirmaPiccola = dataFoto.ToShortDateString();
|
||||||
if (CatalogVbLib.PicSettings.UsaOrarioTestoApplicare)
|
if (_picSettings.UsaOrarioTestoApplicare)
|
||||||
{
|
{
|
||||||
testoFirma = string.Concat(testoFirma, " ", dataFoto.ToShortDateString(), " ",
|
testoFirma = $"{testoFirma} {dataFoto.ToShortDateString()} {dataFoto.ToLongDateString()}";
|
||||||
dataFoto.ToLongDateString());
|
testoFirmaV = $"{testoFirmaV} {dataFoto.ToShortDateString()} {dataFoto.ToLongDateString()}";
|
||||||
testoFirmaV = string.Concat(testoFirmaV, " ", dataFoto.ToShortDateString(), " ",
|
//testoFirma = string.Concat(testoFirma, " ", dataFoto.ToShortDateString(), " ", dataFoto.ToLongDateString());
|
||||||
dataFoto.ToLongDateString());
|
//testoFirmaV = string.Concat(testoFirmaV, " ", dataFoto.ToShortDateString(), " ", dataFoto.ToLongDateString());
|
||||||
|
|
||||||
}
|
}
|
||||||
if (CatalogVbLib.PicSettings.UsaTempoGaraTestoApplicare)
|
if (_picSettings.UsaTempoGaraTestoApplicare)
|
||||||
{
|
{
|
||||||
TimeSpan orario = dataPartenzaI - dataFoto;
|
//TimeSpan orario = dataPartenzaI - dataFoto;
|
||||||
testoFirma = string.Concat(testoFirma, " ", testoOrario, orario.ToString(@"hh\:mm\:ss"));
|
|
||||||
testoFirmaV = string.Concat(testoFirmaV, " ", testoOrario, orario.ToString(@"hh\:mm\:ss"));
|
string orarioString = (dataPartenzaI - dataFoto).ToString(@"hh\:mm\:ss");
|
||||||
|
|
||||||
|
testoFirma = $"{testoFirma} {testoOrario} {orarioString}";
|
||||||
|
testoFirmaV = $"{testoFirmaV} {testoOrario} {orarioString}";
|
||||||
|
|
||||||
|
//testoFirma = string.Concat(testoFirma, " ", testoOrario, orario.ToString(@"hh\:mm\:ss"));
|
||||||
|
//testoFirmaV = string.Concat(testoFirmaV, " ", testoOrario, orario.ToString(@"hh\:mm\:ss"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
testoFirma = CatalogVbLib.PicSettings.TestoFirmaStart;
|
testoFirma = _picSettings.TestoFirmaStart;
|
||||||
testoFirmaV = CatalogVbLib.PicSettings.TestoFirmaStartV;
|
testoFirmaV = _picSettings.TestoFirmaStartV;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Preparazione delle variabili a valori di default e caricamento da impostazioni
|
||||||
|
/// </summary>
|
||||||
private void PreparaVariabili()
|
private void PreparaVariabili()
|
||||||
{
|
{
|
||||||
alphaScelta = (int)(255 * (100 - CatalogVbLib.PicSettings.Trasparenza) / 100);
|
alphaScelta = (int)(255 * (100 - _picSettings.Trasparenza) / 100);
|
||||||
testoFirma = string.Empty;
|
testoFirma = string.Empty;
|
||||||
testoFirmaV = string.Empty;
|
testoFirmaV = string.Empty;
|
||||||
dataPartenzaI = CatalogVbLib.PicSettings.DataPartenza;
|
dataPartenzaI = _picSettings.DataPartenza;
|
||||||
testoOrario = CatalogVbLib.PicSettings.TestoOrario;
|
testoOrario = _picSettings.TestoOrario;
|
||||||
if (testoOrario.Length > 0)
|
if (testoOrario.Length > 0)
|
||||||
{
|
{
|
||||||
testoOrario += " ";
|
testoOrario += " ";
|
||||||
|
|
@ -241,10 +289,10 @@ namespace CatalogLib
|
||||||
nomeFileSmall = string.Empty;
|
nomeFileSmall = string.Empty;
|
||||||
nomeFileBig2 = string.Empty;
|
nomeFileBig2 = string.Empty;
|
||||||
nomeFileBig = string.Empty;
|
nomeFileBig = string.Empty;
|
||||||
_dimensioneStandard = CatalogVbLib.PicSettings.DimStandard;
|
_dimensioneStandard = _picSettings.DimStandard;
|
||||||
_dimensioneStandardMiniatura = CatalogVbLib.PicSettings.DimStandardMiniatura;
|
_dimensioneStandardMiniatura = _picSettings.DimStandardMiniatura;
|
||||||
|
|
||||||
nomeFileSmall = CatalogVbLib.PicSettings.Suffisso + WorkFile.Name;
|
nomeFileSmall = _picSettings.Suffisso + WorkFile.Name;
|
||||||
nomeFileBig = WorkFile.Name;
|
nomeFileBig = WorkFile.Name;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -253,27 +301,28 @@ namespace CatalogLib
|
||||||
if (g.Width > g.Height)
|
if (g.Width > g.Height)
|
||||||
{
|
{
|
||||||
thumbSizeSmall = NewthumbSize(g.Width, g.Height, CatalogVbLib.PicSettings.LarghezzaSmall, "Larghezza");
|
thumbSizeSmall = NewthumbSize(g.Width, g.Height, CatalogVbLib.PicSettings.LarghezzaSmall, "Larghezza");
|
||||||
Size sizeOrig = new Size(g.Width, g.Height);
|
//Size sizeOrig = new Size(g.Width, g.Height);
|
||||||
thumbSizeBig = sizeOrig;
|
//thumbSizeBig = sizeOrig;
|
||||||
|
|
||||||
|
thumbSizeBig = new Size(g.Width, g.Height);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
thumbSizeSmall = NewthumbSize(g.Width, g.Height, CatalogVbLib.PicSettings.AltezzaSmall, "Altezza");
|
thumbSizeSmall = NewthumbSize(g.Width, g.Height, CatalogVbLib.PicSettings.AltezzaSmall, "Altezza");
|
||||||
Size sizeOrig = new Size(g.Width, g.Height);
|
|
||||||
thumbSizeBig = sizeOrig;
|
thumbSizeBig = new Size(g.Width, g.Height);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void CreaMiniature(Image g, Bitmap imgOutputBig, ImageFormat thisFormat)
|
private void CreaMiniature(Image g, Bitmap imgOutputBig, ImageFormat thisFormat)
|
||||||
{
|
{
|
||||||
CatalogLib.PicSettings ps = new PicSettings();
|
// CatalogLib.PicSettings ps = new PicSettings();
|
||||||
|
|
||||||
if (CatalogVbLib.PicSettings.TestoMin)
|
if (_picSettings.TestoMin)
|
||||||
{
|
{
|
||||||
testoFirmaPiccola = nomeFileBig;
|
testoFirmaPiccola = nomeFileBig;
|
||||||
|
|
||||||
}
|
}
|
||||||
else if (CatalogVbLib.PicSettings.AggNumTempMin)
|
else if (_picSettings.AggNumTempMin)
|
||||||
{
|
{
|
||||||
testoFirmaPiccola = nomeFileBig + " ";
|
testoFirmaPiccola = nomeFileBig + " ";
|
||||||
}
|
}
|
||||||
|
|
@ -283,20 +332,20 @@ namespace CatalogLib
|
||||||
SizeF crSize1 = new SizeF();
|
SizeF crSize1 = new SizeF();
|
||||||
SizeF crSize2 = new SizeF();
|
SizeF crSize2 = new SizeF();
|
||||||
|
|
||||||
if (CatalogVbLib.PicSettings.CreaMiniature)
|
if (_picSettings.CreaMiniature)
|
||||||
{
|
{
|
||||||
if (!CatalogVbLib.PicSettings.AggiungiScritteMiniature)
|
if (!_picSettings.AggiungiScritteMiniature)
|
||||||
{
|
{
|
||||||
if (string.Equals(CatalogVbLib.PicSettings.DirectorySorgente, CatalogVbLib.PicSettings.DirectoryDestinazione, StringComparison.CurrentCultureIgnoreCase))
|
if (string.Equals(_picSettings.DirectorySorgente, _picSettings.DirectoryDestinazione, StringComparison.CurrentCultureIgnoreCase))
|
||||||
{
|
{
|
||||||
nomeFileSmall = nomeFileSmall.Substring(0, nomeFileSmall.Length - 4) + CatalogVbLib.PicSettings.Codice +
|
nomeFileSmall = nomeFileSmall.Substring(0, nomeFileSmall.Length - 4) + _picSettings.Codice +
|
||||||
nomeFileSmall.Substring(nomeFileSmall.Length - 4);
|
nomeFileSmall.Substring(nomeFileSmall.Length - 4);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (CatalogVbLib.PicSettings.UsaOrarioMiniatura ||
|
if (_picSettings.UsaOrarioMiniatura ||
|
||||||
CatalogVbLib.PicSettings.TestoMin ||
|
_picSettings.TestoMin ||
|
||||||
CatalogVbLib.PicSettings.AggTempoGaraMin ||
|
_picSettings.AggTempoGaraMin ||
|
||||||
CatalogVbLib.PicSettings.AggNumTempMin)
|
_picSettings.AggNumTempMin)
|
||||||
{
|
{
|
||||||
if (!string.IsNullOrWhiteSpace(testoFirmaPiccola))
|
if (!string.IsNullOrWhiteSpace(testoFirmaPiccola))
|
||||||
{
|
{
|
||||||
|
|
@ -308,9 +357,9 @@ namespace CatalogLib
|
||||||
int larghezzaStandard1;
|
int larghezzaStandard1;
|
||||||
|
|
||||||
_dimensioneStandardMiniatura = 50;
|
_dimensioneStandardMiniatura = 50;
|
||||||
bool grassetto = CatalogVbLib.PicSettings.Grassetto;
|
bool grassetto = _picSettings.Grassetto;
|
||||||
crFont1 = new Font(CatalogVbLib.PicSettings.IlFont, _dimensioneStandardMiniatura, grassetto ? FontStyle.Bold : FontStyle.Regular);
|
crFont1 = new Font(_picSettings.IlFont, _dimensioneStandardMiniatura, grassetto ? FontStyle.Bold : FontStyle.Regular);
|
||||||
crFont2 = new Font(CatalogVbLib.PicSettings.IlFont, _dimensioneStandard, grassetto ? FontStyle.Bold : FontStyle.Regular);
|
crFont2 = new Font(_picSettings.IlFont, _dimensioneStandard, grassetto ? FontStyle.Bold : FontStyle.Regular);
|
||||||
|
|
||||||
crSize1 = grPhoto1.MeasureString(testoFirmaPiccola, crFont1);
|
crSize1 = grPhoto1.MeasureString(testoFirmaPiccola, crFont1);
|
||||||
crSize2 = grPhoto1.MeasureString(testoFirma, crFont1);
|
crSize2 = grPhoto1.MeasureString(testoFirma, crFont1);
|
||||||
|
|
@ -331,7 +380,7 @@ namespace CatalogLib
|
||||||
conta -= 1;
|
conta -= 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
crFont1 = new Font(CatalogVbLib.PicSettings.IlFont, conta, grassetto ? FontStyle.Bold : FontStyle.Regular);
|
crFont1 = new Font(_picSettings.IlFont, conta, grassetto ? FontStyle.Bold : FontStyle.Regular);
|
||||||
crSize1 = grPhoto1.MeasureString(testoFirmaPiccola, crFont1);
|
crSize1 = grPhoto1.MeasureString(testoFirmaPiccola, crFont1);
|
||||||
|
|
||||||
if (crSize1.Width < g.Width)
|
if (crSize1.Width < g.Width)
|
||||||
|
|
@ -345,11 +394,11 @@ namespace CatalogLib
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (CatalogVbLib.PicSettings.Posizione.ToUpper())
|
switch (_picSettings.Posizione.ToUpper())
|
||||||
{
|
{
|
||||||
case "ALTO":
|
case "ALTO":
|
||||||
yPosFromBottom1 = CatalogVbLib.PicSettings.Margine;
|
yPosFromBottom1 = _picSettings.Margine;
|
||||||
yPosFromBottom4 = CatalogVbLib.PicSettings.MargVert;
|
yPosFromBottom4 = _picSettings.MargVert;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case "BASSO":
|
case "BASSO":
|
||||||
|
|
@ -365,7 +414,7 @@ namespace CatalogLib
|
||||||
|
|
||||||
StringFormat strFormat1 = new StringFormat();
|
StringFormat strFormat1 = new StringFormat();
|
||||||
|
|
||||||
switch (CatalogVbLib.PicSettings.Allineamento.ToUpper())
|
switch (_picSettings.Allineamento.ToUpper())
|
||||||
{
|
{
|
||||||
case "SINISTRA":
|
case "SINISTRA":
|
||||||
xCenterOfImg1 = CatalogVbLib.PicSettings.Margine + (larghezzaStandard1 / 2);
|
xCenterOfImg1 = CatalogVbLib.PicSettings.Margine + (larghezzaStandard1 / 2);
|
||||||
|
|
@ -396,21 +445,21 @@ namespace CatalogLib
|
||||||
|
|
||||||
_dimensioneStandardMiniatura = CatalogVbLib.PicSettings.DimMin;
|
_dimensioneStandardMiniatura = CatalogVbLib.PicSettings.DimMin;
|
||||||
|
|
||||||
if (ps.Grassetto)
|
if (_picSettings.Grassetto)
|
||||||
{
|
{
|
||||||
crFont1 = new Font(ps.IlFont, _dimensioneStandardMiniatura, FontStyle.Bold);
|
crFont1 = new Font(_picSettings.IlFont, _dimensioneStandardMiniatura, FontStyle.Bold);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
crFont1 = new Font(ps.IlFont, _dimensioneStandardMiniatura);
|
crFont1 = new Font(_picSettings.IlFont, _dimensioneStandardMiniatura);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ps.TestoMin)
|
if (_picSettings.TestoMin)
|
||||||
{
|
{
|
||||||
grPhoto1.DrawString(nomeFileBig, crFont1, semiTransBrush21, new PointF(xCenterOfImg1 + 1, yPosFromBottom1 + 1), strFormat1);
|
grPhoto1.DrawString(nomeFileBig, crFont1, semiTransBrush21, new PointF(xCenterOfImg1 + 1, yPosFromBottom1 + 1), strFormat1);
|
||||||
grPhoto1.DrawString(nomeFileBig, crFont1, semiTransBrush1, new PointF(xCenterOfImg1, yPosFromBottom1), strFormat1);
|
grPhoto1.DrawString(nomeFileBig, crFont1, semiTransBrush1, new PointF(xCenterOfImg1, yPosFromBottom1), strFormat1);
|
||||||
}
|
}
|
||||||
else if (ps.AggTempoGaraMin & ps.UsaTempoGaraTestoApplicare)
|
else if (_picSettings.AggTempoGaraMin & _picSettings.UsaTempoGaraTestoApplicare)
|
||||||
{
|
{
|
||||||
//TimeSpan orario = (dataPartenzaI - dataFoto) * 10000000; //todo
|
//TimeSpan orario = (dataPartenzaI - dataFoto) * 10000000; //todo
|
||||||
TimeSpan orario = dataPartenzaI - dataFoto; //todo controllare se torna la roba giusta
|
TimeSpan orario = dataPartenzaI - dataFoto; //todo controllare se torna la roba giusta
|
||||||
|
|
@ -425,7 +474,7 @@ namespace CatalogLib
|
||||||
grPhoto1.DrawString(tempStr, crFont1, semiTransBrush21, new PointF(xCenterOfImg1 + 1, yPosFromBottom1 + 1));
|
grPhoto1.DrawString(tempStr, crFont1, semiTransBrush21, new PointF(xCenterOfImg1 + 1, yPosFromBottom1 + 1));
|
||||||
grPhoto1.DrawString(tempStr, crFont1, semiTransBrush1, new PointF(xCenterOfImg1, yPosFromBottom1), strFormat1);
|
grPhoto1.DrawString(tempStr, crFont1, semiTransBrush1, new PointF(xCenterOfImg1, yPosFromBottom1), strFormat1);
|
||||||
}
|
}
|
||||||
else if (ps.AggNumTempMin) //todo semplificare la logica di sti eif
|
else if (_picSettings.AggNumTempMin) //todo semplificare la logica di sti eif
|
||||||
{
|
{
|
||||||
TimeSpan orario = dataPartenzaI - dataFoto; //todo controllare se torna la roba giusta
|
TimeSpan orario = dataPartenzaI - dataFoto; //todo controllare se torna la roba giusta
|
||||||
string tempStr = "";
|
string tempStr = "";
|
||||||
|
|
@ -443,7 +492,7 @@ namespace CatalogLib
|
||||||
|
|
||||||
|
|
||||||
//Salva miniatura
|
//Salva miniatura
|
||||||
|
|
||||||
imgOutputSmall.Save(Path.Combine(DestDir.FullName, "Temp_" + nomeFileSmall), thisFormat);
|
imgOutputSmall.Save(Path.Combine(DestDir.FullName, "Temp_" + nomeFileSmall), thisFormat);
|
||||||
float width = 0;
|
float width = 0;
|
||||||
float height = 0;
|
float height = 0;
|
||||||
|
|
|
||||||
|
|
@ -146,12 +146,25 @@ namespace CatalogLib
|
||||||
get { return 0; }
|
get { return 0; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool Posizione
|
public string Posizione
|
||||||
{
|
{
|
||||||
get { return null; }
|
get { return string.Empty; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public bool UsaRotazioneAutomatica { get; set; }
|
||||||
|
public DateTime DataPartenza { get; set; }
|
||||||
|
public string TestoOrario { get; internal set; }
|
||||||
|
public int DimStandard { get; internal set; }
|
||||||
|
public int DimStandardMiniatura { get; internal set; }
|
||||||
|
public bool UsaOrarioTestoApplicare { get; set; }
|
||||||
|
public bool UsaOrarioMiniatura { get; set; }
|
||||||
|
public string TestoFirmaStart { get; set; }
|
||||||
|
public string TestoFirmaStartV { get; set; }
|
||||||
|
public bool UsaForzaJpg { get; set; }
|
||||||
|
public string DirectorySorgente { get; set; }
|
||||||
|
public string DirectoryDestinazione { get; set; }
|
||||||
|
public float Margine { get; set; }
|
||||||
|
public float MargVert { get; set; }
|
||||||
|
public string Allineamento { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
22
CatalogLib/SinglePicData.cs
Normal file
22
CatalogLib/SinglePicData.cs
Normal file
|
|
@ -0,0 +1,22 @@
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace CatalogLib
|
||||||
|
{
|
||||||
|
public enum Rotazione
|
||||||
|
{
|
||||||
|
Normale,
|
||||||
|
Destra,
|
||||||
|
Sinistra,
|
||||||
|
Sottosopra
|
||||||
|
}
|
||||||
|
|
||||||
|
public class SinglePicData
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue