ayy lmao
This commit is contained in:
parent
abbe94a72c
commit
3b1afdf2c0
92 changed files with 23248 additions and 0 deletions
BIN
Catalog.sln.ide/edb.chk
Normal file
BIN
Catalog.sln.ide/edb.chk
Normal file
Binary file not shown.
BIN
Catalog.sln.ide/edbres00001.jrs
Normal file
BIN
Catalog.sln.ide/edbres00001.jrs
Normal file
Binary file not shown.
BIN
Catalog.sln.ide/edbres00002.jrs
Normal file
BIN
Catalog.sln.ide/edbres00002.jrs
Normal file
Binary file not shown.
BIN
Catalog.sln.ide/storage.ide
Normal file
BIN
Catalog.sln.ide/storage.ide
Normal file
Binary file not shown.
66
CatalogLib/CatalogLib.csproj
Normal file
66
CatalogLib/CatalogLib.csproj
Normal file
|
|
@ -0,0 +1,66 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.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')" />
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProjectGuid>{D27ACCF2-80FC-4DE8-AEB8-351FF076E6D5}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>CatalogLib</RootNamespace>
|
||||
<AssemblyName>CatalogLib</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<SccProjectName>SAK</SccProjectName>
|
||||
<SccLocalPath>SAK</SccLocalPath>
|
||||
<SccAuxPath>SAK</SccAuxPath>
|
||||
<SccProvider>SAK</SccProvider>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Drawing" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Class1.cs" />
|
||||
<Compile Include="ImageCreator.cs" />
|
||||
<Compile Include="PicSettings.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\CatalogVbLib\CatalogVbLib.vbproj">
|
||||
<Project>{44465926-240d-473f-90b8-786ba4384406}</Project>
|
||||
<Name>CatalogVbLib</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
<Target Name="BeforeBuild">
|
||||
</Target>
|
||||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
-->
|
||||
</Project>
|
||||
12
CatalogLib/Class1.cs
Normal file
12
CatalogLib/Class1.cs
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace CatalogLib
|
||||
{
|
||||
public class Class1
|
||||
{
|
||||
}
|
||||
}
|
||||
569
CatalogLib/ImageCreator.cs
Normal file
569
CatalogLib/ImageCreator.cs
Normal file
|
|
@ -0,0 +1,569 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Drawing.Drawing2D;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Drawing;
|
||||
using System.Drawing.Imaging;
|
||||
using CatalogVbLib;
|
||||
|
||||
namespace CatalogLib
|
||||
{
|
||||
public class ImageCreator
|
||||
{
|
||||
|
||||
#region "dichiarazioni"
|
||||
|
||||
|
||||
private bool FotoRuotaADestra = false;
|
||||
|
||||
private bool FotoRuotaASinistra = false;
|
||||
private string TempMinText = "";
|
||||
//Private crFont1 As Font
|
||||
|
||||
private string _NomeFileChild;
|
||||
private DirectoryInfo _SourceDir;
|
||||
private DirectoryInfo _DestDirStart;
|
||||
|
||||
private DirectoryInfo _DestDir;
|
||||
|
||||
private FileInfo _workFile;
|
||||
private string testoFirma;
|
||||
private string testoFirmaV;
|
||||
private int alphaScelta;
|
||||
private int _dimensioneStandard;
|
||||
private int _dimensioneStandardMiniatura;
|
||||
private DateTime dataFoto;
|
||||
private DateTime dataPartenzaI;
|
||||
private string testoOrario;
|
||||
private string testoFirmaPiccola;
|
||||
private Size thumbSizeSmall;
|
||||
private Size thumbSizeBig;
|
||||
private string nomeFileSmall;
|
||||
private string nomeFileBig;
|
||||
|
||||
private string nomeFileBig2;
|
||||
private float yPosFromBottom;
|
||||
private float yPosFromBottom1;
|
||||
private float yPosFromBottom2;
|
||||
private float yPosFromBottom3;
|
||||
private float yPosFromBottom4;
|
||||
|
||||
public string NomeFileChild
|
||||
{
|
||||
get { return _NomeFileChild; }
|
||||
set { _NomeFileChild = value; }
|
||||
}
|
||||
|
||||
public DirectoryInfo DestDirStart
|
||||
{
|
||||
get { return _DestDirStart; }
|
||||
set { _DestDirStart = value; }
|
||||
}
|
||||
|
||||
public DirectoryInfo SourceDir
|
||||
{
|
||||
get { return _SourceDir; }
|
||||
set { _SourceDir = value; }
|
||||
}
|
||||
|
||||
public DirectoryInfo DestDir
|
||||
{
|
||||
get { return _DestDir; }
|
||||
set { _DestDir = value; }
|
||||
}
|
||||
|
||||
public FileInfo WorkFile
|
||||
{
|
||||
get { return _workFile; }
|
||||
set { _workFile = value; }
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
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 StringDigitSubstitute CreaImmagineThread(string info)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public void CreaImmagineThread(string info)
|
||||
{
|
||||
|
||||
CatalogLib.PicSettings ps = new CatalogLib.PicSettings();
|
||||
|
||||
Image g = Image.FromFile(WorkFile.FullName);
|
||||
|
||||
|
||||
|
||||
if (ps.CreaMiniature)
|
||||
{
|
||||
CreaMiniature();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
private void Rotation(ref System.Drawing.Image g)
|
||||
{
|
||||
FotoRuotaADestra = false;
|
||||
FotoRuotaASinistra = false;
|
||||
|
||||
if (CatalogVbLib.PicSettings.UsaRotazioneAutomatica == true)
|
||||
{
|
||||
// ci sono dati exif
|
||||
if (g.PropertyIdList.Length > 0)
|
||||
{
|
||||
ExifReader DatiExif = new ExifReader((Bitmap)g);
|
||||
|
||||
switch (DatiExif.Orientation)
|
||||
{
|
||||
case ExifReader.Orientations.BottomLeft:
|
||||
|
||||
break;
|
||||
case ExifReader.Orientations.BottomRight:
|
||||
|
||||
break;
|
||||
case ExifReader.Orientations.LeftTop:
|
||||
|
||||
break;
|
||||
case ExifReader.Orientations.LftBottom:
|
||||
FotoRuotaASinistra = true;
|
||||
break;
|
||||
case ExifReader.Orientations.RightBottom:
|
||||
|
||||
break;
|
||||
case ExifReader.Orientations.RightTop:
|
||||
|
||||
break;
|
||||
case ExifReader.Orientations.TopLeft:
|
||||
|
||||
break;
|
||||
case ExifReader.Orientations.TopRight:
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (FotoRuotaASinistra == true)
|
||||
{
|
||||
g.RotateFlip(RotateFlipType.Rotate270FlipNone);
|
||||
}
|
||||
if (FotoRuotaADestra == true)
|
||||
{
|
||||
g.RotateFlip(RotateFlipType.Rotate90FlipNone);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void ImpostaTestoExtra(Image g)
|
||||
{
|
||||
if (CatalogVbLib.PicSettings.UsaOrarioTestoApplicare ||
|
||||
CatalogVbLib.PicSettings.UsaTempoGaraTestoApplicare ||
|
||||
CatalogVbLib.PicSettings.UsaOrarioMiniatura ||
|
||||
CatalogVbLib.PicSettings.TestoMin ||
|
||||
CatalogVbLib.PicSettings.AggTempoGaraMin ||
|
||||
CatalogVbLib.PicSettings.AggNumTempMin)
|
||||
{
|
||||
if (g.PropertyIdList.Length > 0) //ci sono dati exif
|
||||
{
|
||||
var datiExix = new ExifReader((Bitmap)g);
|
||||
dataFoto = datiExix.DateTimeOriginal;
|
||||
testoFirma = CatalogVbLib.PicSettings.TestoFirmaStart;
|
||||
testoFirmaV = CatalogVbLib.PicSettings.TestoFirmaStartV;
|
||||
|
||||
if (dataFoto.Year != 1)
|
||||
{
|
||||
testoFirmaPiccola = dataFoto.ToShortDateString();
|
||||
if (CatalogVbLib.PicSettings.UsaOrarioTestoApplicare)
|
||||
{
|
||||
testoFirma = string.Concat(testoFirma, " ", dataFoto.ToShortDateString(), " ",
|
||||
dataFoto.ToLongDateString());
|
||||
testoFirmaV = string.Concat(testoFirmaV, " ", dataFoto.ToShortDateString(), " ",
|
||||
dataFoto.ToLongDateString());
|
||||
|
||||
}
|
||||
if (CatalogVbLib.PicSettings.UsaTempoGaraTestoApplicare)
|
||||
{
|
||||
TimeSpan orario = dataPartenzaI - dataFoto;
|
||||
testoFirma = string.Concat(testoFirma, " ", testoOrario, orario.ToString(@"hh\:mm\:ss"));
|
||||
testoFirmaV = string.Concat(testoFirmaV, " ", testoOrario, orario.ToString(@"hh\:mm\:ss"));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
testoFirma = CatalogVbLib.PicSettings.TestoFirmaStart;
|
||||
testoFirmaV = CatalogVbLib.PicSettings.TestoFirmaStartV;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private void PreparaVariabili()
|
||||
{
|
||||
alphaScelta = (int)(255 * (100 - CatalogVbLib.PicSettings.Trasparenza) / 100);
|
||||
testoFirma = string.Empty;
|
||||
testoFirmaV = string.Empty;
|
||||
dataPartenzaI = CatalogVbLib.PicSettings.DataPartenza;
|
||||
testoOrario = CatalogVbLib.PicSettings.TestoOrario;
|
||||
if (testoOrario.Length > 0)
|
||||
{
|
||||
testoOrario += " ";
|
||||
}
|
||||
testoFirmaPiccola = string.Empty;
|
||||
thumbSizeSmall = new Size();
|
||||
thumbSizeBig = new Size();
|
||||
nomeFileSmall = string.Empty;
|
||||
nomeFileBig2 = string.Empty;
|
||||
nomeFileBig = string.Empty;
|
||||
_dimensioneStandard = CatalogVbLib.PicSettings.DimStandard;
|
||||
_dimensioneStandardMiniatura = CatalogVbLib.PicSettings.DimStandardMiniatura;
|
||||
|
||||
nomeFileSmall = CatalogVbLib.PicSettings.Suffisso + WorkFile.Name;
|
||||
nomeFileBig = WorkFile.Name;
|
||||
}
|
||||
|
||||
private void PrepareThumbnailSize(Image g)
|
||||
{
|
||||
if (g.Width > g.Height)
|
||||
{
|
||||
thumbSizeSmall = NewthumbSize(g.Width, g.Height, CatalogVbLib.PicSettings.LarghezzaSmall, "Larghezza");
|
||||
Size sizeOrig = new Size(g.Width, g.Height);
|
||||
thumbSizeBig = sizeOrig;
|
||||
}
|
||||
else
|
||||
{
|
||||
thumbSizeSmall = NewthumbSize(g.Width, g.Height, CatalogVbLib.PicSettings.AltezzaSmall, "Altezza");
|
||||
Size sizeOrig = new Size(g.Width, g.Height);
|
||||
thumbSizeBig = sizeOrig;
|
||||
}
|
||||
}
|
||||
|
||||
private void CreaMiniature(Image g, Bitmap imgOutputBig, ImageFormat thisFormat)
|
||||
{
|
||||
CatalogLib.PicSettings ps = new PicSettings();
|
||||
|
||||
if (CatalogVbLib.PicSettings.TestoMin)
|
||||
{
|
||||
testoFirmaPiccola = nomeFileBig;
|
||||
|
||||
}
|
||||
else if (CatalogVbLib.PicSettings.AggNumTempMin)
|
||||
{
|
||||
testoFirmaPiccola = nomeFileBig + " ";
|
||||
}
|
||||
|
||||
Font crFont1;
|
||||
Font crFont2;
|
||||
SizeF crSize1 = new SizeF();
|
||||
SizeF crSize2 = new SizeF();
|
||||
|
||||
if (CatalogVbLib.PicSettings.CreaMiniature)
|
||||
{
|
||||
if (!CatalogVbLib.PicSettings.AggiungiScritteMiniature)
|
||||
{
|
||||
if (string.Equals(CatalogVbLib.PicSettings.DirectorySorgente, CatalogVbLib.PicSettings.DirectoryDestinazione, StringComparison.CurrentCultureIgnoreCase))
|
||||
{
|
||||
nomeFileSmall = nomeFileSmall.Substring(0, nomeFileSmall.Length - 4) + CatalogVbLib.PicSettings.Codice +
|
||||
nomeFileSmall.Substring(nomeFileSmall.Length - 4);
|
||||
}
|
||||
|
||||
if (CatalogVbLib.PicSettings.UsaOrarioMiniatura ||
|
||||
CatalogVbLib.PicSettings.TestoMin ||
|
||||
CatalogVbLib.PicSettings.AggTempoGaraMin ||
|
||||
CatalogVbLib.PicSettings.AggNumTempMin)
|
||||
{
|
||||
if (!string.IsNullOrWhiteSpace(testoFirmaPiccola))
|
||||
{
|
||||
Bitmap imgOutputSmall = (Bitmap)imgOutputBig.Clone();
|
||||
|
||||
Graphics grPhoto1 = Graphics.FromImage(imgOutputSmall);
|
||||
grPhoto1.SmoothingMode = SmoothingMode.HighSpeed; //Todo: permettere di cambiare questo parametro
|
||||
|
||||
int larghezzaStandard1;
|
||||
|
||||
_dimensioneStandardMiniatura = 50;
|
||||
bool grassetto = CatalogVbLib.PicSettings.Grassetto;
|
||||
crFont1 = new Font(CatalogVbLib.PicSettings.IlFont, _dimensioneStandardMiniatura, grassetto ? FontStyle.Bold : FontStyle.Regular);
|
||||
crFont2 = new Font(CatalogVbLib.PicSettings.IlFont, _dimensioneStandard, grassetto ? FontStyle.Bold : FontStyle.Regular);
|
||||
|
||||
crSize1 = grPhoto1.MeasureString(testoFirmaPiccola, crFont1);
|
||||
crSize2 = grPhoto1.MeasureString(testoFirma, crFont1);
|
||||
|
||||
larghezzaStandard1 = (int)crSize1.Width;
|
||||
|
||||
if (crSize1.Width > g.Width)
|
||||
{
|
||||
int conta = _dimensioneStandardMiniatura;
|
||||
do
|
||||
{
|
||||
if (conta > 20)
|
||||
{
|
||||
conta -= 5;
|
||||
}
|
||||
else
|
||||
{
|
||||
conta -= 1;
|
||||
}
|
||||
|
||||
crFont1 = new Font(CatalogVbLib.PicSettings.IlFont, conta, grassetto ? FontStyle.Bold : FontStyle.Regular);
|
||||
crSize1 = grPhoto1.MeasureString(testoFirmaPiccola, crFont1);
|
||||
|
||||
if (crSize1.Width < g.Width)
|
||||
{
|
||||
larghezzaStandard1 = (int)crSize1.Width;
|
||||
break;
|
||||
}
|
||||
|
||||
} while (conta > 5);
|
||||
_dimensioneStandardMiniatura = conta;
|
||||
|
||||
}
|
||||
|
||||
switch (CatalogVbLib.PicSettings.Posizione.ToUpper())
|
||||
{
|
||||
case "ALTO":
|
||||
yPosFromBottom1 = CatalogVbLib.PicSettings.Margine;
|
||||
yPosFromBottom4 = CatalogVbLib.PicSettings.MargVert;
|
||||
break;
|
||||
|
||||
case "BASSO":
|
||||
yPosFromBottom1 =
|
||||
(float)
|
||||
(g.Height - crSize1.Height - (g.Height * CatalogVbLib.PicSettings.Margine / 100));
|
||||
yPosFromBottom4 = (float)(g.Height - crSize1.Height - (g.Height * CatalogVbLib.PicSettings.MargVert / 100));
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
float xCenterOfImg1 = Single.NaN;
|
||||
|
||||
StringFormat strFormat1 = new StringFormat();
|
||||
|
||||
switch (CatalogVbLib.PicSettings.Allineamento.ToUpper())
|
||||
{
|
||||
case "SINISTRA":
|
||||
xCenterOfImg1 = CatalogVbLib.PicSettings.Margine + (larghezzaStandard1 / 2);
|
||||
if ((larghezzaStandard1 / 2) > (g.Width / 2) - CatalogVbLib.PicSettings.Margine)
|
||||
{
|
||||
xCenterOfImg1 = g.Width / 2;
|
||||
}
|
||||
break;
|
||||
|
||||
case "CENTRO":
|
||||
xCenterOfImg1 = (g.Width / 2);
|
||||
break;
|
||||
|
||||
case "DESTRA":
|
||||
xCenterOfImg1 = (g.Width - CatalogVbLib.PicSettings.Margine - (larghezzaStandard1 / 2));
|
||||
if ((larghezzaStandard1 / 2) > (g.Width / 2) - CatalogVbLib.PicSettings.Margine)
|
||||
{
|
||||
xCenterOfImg1 = g.Width / 2;
|
||||
}
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
strFormat1.Alignment = StringAlignment.Center;
|
||||
|
||||
SolidBrush semiTransBrush21 = new SolidBrush(Color.FromArgb(alphaScelta, 0, 0, 0));
|
||||
SolidBrush semiTransBrush1 = new SolidBrush(Color.FromArgb(alphaScelta, CatalogVbLib.PicSettings.fontColoreRGB));
|
||||
|
||||
_dimensioneStandardMiniatura = CatalogVbLib.PicSettings.DimMin;
|
||||
|
||||
if (ps.Grassetto)
|
||||
{
|
||||
crFont1 = new Font(ps.IlFont, _dimensioneStandardMiniatura, FontStyle.Bold);
|
||||
}
|
||||
else
|
||||
{
|
||||
crFont1 = new Font(ps.IlFont, _dimensioneStandardMiniatura);
|
||||
}
|
||||
|
||||
if (ps.TestoMin)
|
||||
{
|
||||
grPhoto1.DrawString(nomeFileBig, crFont1, semiTransBrush21, new PointF(xCenterOfImg1 + 1, yPosFromBottom1 + 1), strFormat1);
|
||||
grPhoto1.DrawString(nomeFileBig, crFont1, semiTransBrush1, new PointF(xCenterOfImg1, yPosFromBottom1), strFormat1);
|
||||
}
|
||||
else if (ps.AggTempoGaraMin & ps.UsaTempoGaraTestoApplicare)
|
||||
{
|
||||
//TimeSpan orario = (dataPartenzaI - dataFoto) * 10000000; //todo
|
||||
TimeSpan orario = dataPartenzaI - dataFoto; //todo controllare se torna la roba giusta
|
||||
|
||||
string tempStr = "";
|
||||
|
||||
|
||||
|
||||
tempStr += Environment.NewLine + testoOrario + orario.Hours.ToString("00") + ":" +
|
||||
orario.Minutes.ToString("00") + ":" + orario.Seconds.ToString("00"); //todo: usare una stringa formato per sta boiata
|
||||
|
||||
grPhoto1.DrawString(tempStr, crFont1, semiTransBrush21, new PointF(xCenterOfImg1 + 1, yPosFromBottom1 + 1));
|
||||
grPhoto1.DrawString(tempStr, crFont1, semiTransBrush1, new PointF(xCenterOfImg1, yPosFromBottom1), strFormat1);
|
||||
}
|
||||
else if (ps.AggNumTempMin) //todo semplificare la logica di sti eif
|
||||
{
|
||||
TimeSpan orario = dataPartenzaI - dataFoto; //todo controllare se torna la roba giusta
|
||||
string tempStr = "";
|
||||
tempStr += nomeFileBig + Environment.NewLine + testoOrario + orario.Hours.ToString("00") + ":" +
|
||||
orario.Minutes.ToString("00") + ":" + orario.Seconds.ToString("00"); //todo: usare una stringa formato per sta boiata
|
||||
|
||||
grPhoto1.DrawString(tempStr, crFont1, semiTransBrush21, new PointF(xCenterOfImg1 + 1, yPosFromBottom1 + 1));
|
||||
grPhoto1.DrawString(tempStr, crFont1, semiTransBrush1, new PointF(xCenterOfImg1, yPosFromBottom1), strFormat1);
|
||||
}
|
||||
else
|
||||
{
|
||||
grPhoto1.DrawString(testoFirmaPiccola, crFont1, semiTransBrush21, new PointF(xCenterOfImg1 + 1, yPosFromBottom1 + 1), strFormat1);
|
||||
grPhoto1.DrawString(testoFirmaPiccola, crFont1, semiTransBrush1, new PointF(xCenterOfImg1, yPosFromBottom1), strFormat1);
|
||||
}
|
||||
|
||||
|
||||
//Salva miniatura
|
||||
|
||||
imgOutputSmall.Save(Path.Combine(DestDir.FullName, "Temp_" + nomeFileSmall), thisFormat);
|
||||
float width = 0;
|
||||
float height = 0;
|
||||
//float scale = Math.Min(width/imgOutputSmall.Width, height/imgOutputSmall.Height);
|
||||
using (var bmp = new Bitmap(thumbSizeSmall.Width, thumbSizeSmall.Height))
|
||||
{
|
||||
using (var graph = Graphics.FromImage(bmp))
|
||||
{
|
||||
// uncomment for higher quality output
|
||||
//graph.InterpolationMode = InterpolationMode.High;
|
||||
//graph.CompositingQuality = CompositingQuality.HighQuality;
|
||||
//graph.SmoothingMode = SmoothingMode.AntiAlias;
|
||||
|
||||
graph.DrawImage(imgOutputSmall, new Rectangle(0, 0, (int)width, (int)height));
|
||||
|
||||
bmp.Save(Path.Combine(DestDir.FullName, nomeFileSmall), thisFormat);
|
||||
}
|
||||
}
|
||||
//var bmp = new Bitmap(thumbSizeSmall.Width, thumbSizeSmall.Height);
|
||||
//var graph = Graphics.FromImage(bmp);
|
||||
|
||||
|
||||
|
||||
// 10 down vote accepted
|
||||
|
||||
|
||||
//Target parameters:
|
||||
|
||||
//float width = 1024;
|
||||
//float height = 768;
|
||||
//var brush = new SolidBrush(Color.Black);
|
||||
|
||||
//Your original file:
|
||||
|
||||
//var image = new Bitmap(file);
|
||||
|
||||
//Target sizing (scale factor):
|
||||
|
||||
//float scale = Math.Min(width / image.Width, height / image.Height);
|
||||
|
||||
//The resize including brushing canvas first:
|
||||
|
||||
//var bmp = new Bitmap((int)width, (int)height);
|
||||
//var graph = Graphics.FromImage(bmp);
|
||||
|
||||
//// uncomment for higher quality output
|
||||
////graph.InterpolationMode = InterpolationMode.High;
|
||||
////graph.CompositingQuality = CompositingQuality.HighQuality;
|
||||
////graph.SmoothingMode = SmoothingMode.AntiAlias;
|
||||
|
||||
//var scaleWidth = (int)(image.Width * scale);
|
||||
//var scaleHeight = (int)(image.Height * scale);
|
||||
|
||||
//graph.FillRectangle(brush, new RectangleF(0, 0, width, height));
|
||||
//graph.DrawImage(image, new Rectangle(((int)width - scaleWidth)/2, ((int)height - scaleHeight)/2, scaleWidth, scaleHeight));
|
||||
|
||||
|
||||
|
||||
//imgOutputSmall.Save(Path.Combine(DestDir.FullName, nomeFileSmall), thisFormat);
|
||||
|
||||
|
||||
//Image g2 = Image.FromFile(Path.Combine(DestDir.FullName, "Temp_" + nomeFileSmall));
|
||||
//Bitmap imgOutputSmall2 = new Bitmap(g2, thumbSizeSmall.Width, thumbSizeSmall.Height);
|
||||
//imgOutputSmall2.Save(Path.Combine(DestDir.FullName, nomeFileSmall), thisFormat);
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Calculate the Size of the New image
|
||||
/// </summary>
|
||||
/// <param name="currentwidth">Larghezza</param>
|
||||
/// <param name="currentheight">Altezza</param>
|
||||
/// <param name="MaxPixel"></param>
|
||||
/// <param name="TipoSize"></param>
|
||||
/// <returns></returns>
|
||||
/// <remarks></remarks>
|
||||
private Size NewthumbSize(int currentwidth, int currentheight, int MaxPixel, string TipoSize)
|
||||
{
|
||||
// e
|
||||
//*** Larghezza, Altezza, Auto
|
||||
|
||||
double tempMultiplier = 0;
|
||||
|
||||
if (TipoSize.ToUpper() == "Larghezza".ToUpper())
|
||||
{
|
||||
tempMultiplier = MaxPixel / currentwidth;
|
||||
}
|
||||
else if (TipoSize.ToUpper() == "Altezza".ToUpper())
|
||||
{
|
||||
tempMultiplier = MaxPixel / currentheight;
|
||||
}
|
||||
else
|
||||
{
|
||||
// portrait
|
||||
if (currentheight > currentwidth)
|
||||
{
|
||||
tempMultiplier = MaxPixel / currentheight;
|
||||
}
|
||||
else
|
||||
{
|
||||
tempMultiplier = MaxPixel / currentwidth;
|
||||
}
|
||||
}
|
||||
|
||||
Size NewSize = new Size(Convert.ToInt32(currentwidth * tempMultiplier), Convert.ToInt32(currentheight * tempMultiplier));
|
||||
|
||||
return NewSize;
|
||||
}
|
||||
}
|
||||
}
|
||||
157
CatalogLib/PicSettings.cs
Normal file
157
CatalogLib/PicSettings.cs
Normal file
|
|
@ -0,0 +1,157 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Drawing;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace CatalogLib
|
||||
{
|
||||
public class PicSettings
|
||||
{
|
||||
//TODO: Singleton
|
||||
|
||||
private Dictionary<string, object> _settingsDict = new Dictionary<string, object>();
|
||||
|
||||
|
||||
public PicSettings()
|
||||
{
|
||||
SetDefaults();
|
||||
}
|
||||
|
||||
public void Set(string key, object value)
|
||||
{
|
||||
if (_settingsDict.ContainsKey(key))
|
||||
{
|
||||
_settingsDict[key] = value;
|
||||
}
|
||||
else
|
||||
{
|
||||
_settingsDict.Add(key,value);
|
||||
}
|
||||
}
|
||||
|
||||
public bool Exists(string key)
|
||||
{
|
||||
return _settingsDict.ContainsKey(key);
|
||||
}
|
||||
|
||||
public int GetInt(string key)
|
||||
{
|
||||
return _settingsDict.ContainsKey(key) ? (int) _settingsDict[key] : 0;
|
||||
}
|
||||
|
||||
public string GetString(string key)
|
||||
{
|
||||
return _settingsDict.ContainsKey(key) ? (string) _settingsDict[key] : string.Empty;
|
||||
}
|
||||
|
||||
public bool GetBool(string key)
|
||||
{
|
||||
return _settingsDict.ContainsKey(key) && (bool) _settingsDict[key];
|
||||
}
|
||||
|
||||
public void SetBool(string key, bool value)
|
||||
{
|
||||
if (_settingsDict.ContainsKey(key))
|
||||
{
|
||||
_settingsDict[key] = value;
|
||||
}
|
||||
else
|
||||
{
|
||||
_settingsDict.Add(key, value);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public object GetObject(string key)
|
||||
{
|
||||
return _settingsDict.ContainsKey(key) ? _settingsDict[key] : null;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public void SetDefaults()
|
||||
{
|
||||
Set("dirSorgente",string.Empty);
|
||||
Set("dirDestinazione",string.Empty);
|
||||
Set("dirAggiornaSottodirectory", false);
|
||||
Set("dirCreaSottoCartelle",false);
|
||||
//Set();
|
||||
}
|
||||
|
||||
public bool Grassetto
|
||||
{
|
||||
get { return GetBool("Grassetto"); }
|
||||
set { SetBool("Grassetto", value);}
|
||||
}
|
||||
|
||||
public string IlFont //todo
|
||||
{
|
||||
get { return GetString(""); }
|
||||
set { }
|
||||
}
|
||||
|
||||
public bool TestoMin //todo
|
||||
{
|
||||
get { return false; }
|
||||
set { }
|
||||
}
|
||||
|
||||
public bool AggTempoGaraMin //todo
|
||||
{
|
||||
get { return false; }
|
||||
set { }
|
||||
}
|
||||
|
||||
public bool UsaTempoGaraTestoApplicare //todo
|
||||
{
|
||||
get { return false; }
|
||||
set { }
|
||||
}
|
||||
|
||||
public bool AggNumTempMin //todo
|
||||
{
|
||||
get { return false; }
|
||||
set { }
|
||||
}
|
||||
|
||||
public bool CreaMiniature //todo
|
||||
{
|
||||
get { return false; }
|
||||
set { }
|
||||
}
|
||||
|
||||
public bool AggiungiScritteMiniature
|
||||
{
|
||||
get { return false; }
|
||||
set { }
|
||||
}
|
||||
|
||||
public string Suffisso
|
||||
{
|
||||
get { return string.Empty; }
|
||||
set { }
|
||||
}
|
||||
|
||||
public string Codice
|
||||
{
|
||||
get { return null; }
|
||||
set {}
|
||||
}
|
||||
|
||||
public int Trasparenza
|
||||
{
|
||||
get { return 0; }
|
||||
}
|
||||
|
||||
public bool Posizione
|
||||
{
|
||||
get { return null; }
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
38
CatalogLib/Properties/AssemblyInfo.cs
Normal file
38
CatalogLib/Properties/AssemblyInfo.cs
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
using System;
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// General Information about an assembly is controlled through the following
|
||||
// set of attributes. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
[assembly: AssemblyTitle("CatalogLib")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("CatalogLib")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2013")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// Setting ComVisible to false makes the types in this assembly not visible
|
||||
// to COM components. If you need to access a type in this assembly from
|
||||
// COM, set the ComVisible attribute to true on that type.
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
// The following GUID is for the ID of the typelib if this project is exposed to COM
|
||||
[assembly: Guid("7bb8e6ce-72c8-4b36-a166-a62ed446d4e9")]
|
||||
|
||||
// Version information for an assembly consists of the following four values:
|
||||
//
|
||||
// Major Version
|
||||
// Minor Version
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
||||
[assembly: CLSCompliant(true)]
|
||||
57
CatalogLibVb/CatalogLibVb.csproj
Normal file
57
CatalogLibVb/CatalogLibVb.csproj
Normal file
|
|
@ -0,0 +1,57 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<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')" />
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProjectGuid>{B3352D87-BF9F-4F7A-9162-007492DA76E4}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>CatalogLibVb</RootNamespace>
|
||||
<AssemblyName>CatalogLibVb</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<SccProjectName>SAK</SccProjectName>
|
||||
<SccLocalPath>SAK</SccLocalPath>
|
||||
<SccAuxPath>SAK</SccAuxPath>
|
||||
<SccProvider>SAK</SccProvider>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Class1.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
<Target Name="BeforeBuild">
|
||||
</Target>
|
||||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
-->
|
||||
</Project>
|
||||
12
CatalogLibVb/Class1.cs
Normal file
12
CatalogLibVb/Class1.cs
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace CatalogLibVb
|
||||
{
|
||||
public class Class1
|
||||
{
|
||||
}
|
||||
}
|
||||
36
CatalogLibVb/Properties/AssemblyInfo.cs
Normal file
36
CatalogLibVb/Properties/AssemblyInfo.cs
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// Le informazioni generali relative a un assembly sono controllate dal seguente
|
||||
// set di attributi. Per modificare le informazioni associate a un assembly
|
||||
// occorre quindi modificare i valori di questi attributi.
|
||||
[assembly: AssemblyTitle("CatalogLibVb")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("CatalogLibVb")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2014")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// Se si imposta ComVisible su false, i tipi in questo assembly non saranno visibili
|
||||
// ai componenti COM. Se è necessario accedere a un tipo in questo assembly da
|
||||
// COM, impostare su true l'attributo ComVisible per tale tipo.
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
// Se il progetto viene esposto a COM, il GUID che segue verrà utilizzato per creare l'ID della libreria dei tipi
|
||||
[assembly: Guid("367f3879-584c-4780-8ad0-dc84d2e77928")]
|
||||
|
||||
// Le informazioni sulla versione di un assembly sono costituite dai seguenti quattro valori:
|
||||
//
|
||||
// Numero di versione principale
|
||||
// Numero di versione secondario
|
||||
// Numero build
|
||||
// Revisione
|
||||
//
|
||||
// È possibile specificare tutti i valori oppure impostare valori predefiniti per i numeri relativi alla revisione e alla build
|
||||
// utilizzando l'asterisco (*) come descritto di seguito:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
||||
118
CatalogVbLib/CatalogVbLib.vbproj
Normal file
118
CatalogVbLib/CatalogVbLib.vbproj
Normal file
|
|
@ -0,0 +1,118 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<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')" />
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProjectGuid>{44465926-240D-473F-90B8-786BA4384406}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<RootNamespace>CatalogVbLib</RootNamespace>
|
||||
<AssemblyName>CatalogVbLib</AssemblyName>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<MyType>Windows</MyType>
|
||||
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
|
||||
<SccProjectName>SAK</SccProjectName>
|
||||
<SccLocalPath>SAK</SccLocalPath>
|
||||
<SccAuxPath>SAK</SccAuxPath>
|
||||
<SccProvider>SAK</SccProvider>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<DefineDebug>true</DefineDebug>
|
||||
<DefineTrace>true</DefineTrace>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DocumentationFile>CatalogVbLib.xml</DocumentationFile>
|
||||
<NoWarn>42016,41999,42017,42018,42019,42032,42036,42020,42021,42022</NoWarn>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<DefineDebug>false</DefineDebug>
|
||||
<DefineTrace>true</DefineTrace>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DocumentationFile>CatalogVbLib.xml</DocumentationFile>
|
||||
<NoWarn>42016,41999,42017,42018,42019,42032,42036,42020,42021,42022</NoWarn>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<OptionExplicit>On</OptionExplicit>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<OptionCompare>Binary</OptionCompare>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<OptionStrict>Off</OptionStrict>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<OptionInfer>On</OptionInfer>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Drawing" />
|
||||
<Reference Include="System.Windows" />
|
||||
<Reference Include="System.Windows.Forms" />
|
||||
<Reference Include="System.Xml" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Import Include="Microsoft.VisualBasic" />
|
||||
<Import Include="System" />
|
||||
<Import Include="System.Collections" />
|
||||
<Import Include="System.Collections.Generic" />
|
||||
<Import Include="System.Data" />
|
||||
<Import Include="System.Diagnostics" />
|
||||
<Import Include="System.Linq" />
|
||||
<Import Include="System.Xml.Linq" />
|
||||
<Import Include="System.Threading.Tasks" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Class1.vb" />
|
||||
<Compile Include="ExifReader.vb" />
|
||||
<Compile Include="My Project\AssemblyInfo.vb" />
|
||||
<Compile Include="My Project\Application.Designer.vb">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DependentUpon>Application.myapp</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="My Project\Resources.Designer.vb">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DesignTime>True</DesignTime>
|
||||
<DependentUpon>Resources.resx</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="My Project\Settings.Designer.vb">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DependentUpon>Settings.settings</DependentUpon>
|
||||
<DesignTimeSharedInput>True</DesignTimeSharedInput>
|
||||
</Compile>
|
||||
<Compile Include="PicSettings.vb" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="My Project\Resources.resx">
|
||||
<Generator>VbMyResourcesResXFileCodeGenerator</Generator>
|
||||
<LastGenOutput>Resources.Designer.vb</LastGenOutput>
|
||||
<CustomToolNamespace>My.Resources</CustomToolNamespace>
|
||||
<SubType>Designer</SubType>
|
||||
</EmbeddedResource>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="My Project\Application.myapp">
|
||||
<Generator>MyApplicationCodeGenerator</Generator>
|
||||
<LastGenOutput>Application.Designer.vb</LastGenOutput>
|
||||
</None>
|
||||
<None Include="My Project\Settings.settings">
|
||||
<Generator>SettingsSingleFileGenerator</Generator>
|
||||
<CustomToolNamespace>My</CustomToolNamespace>
|
||||
<LastGenOutput>Settings.Designer.vb</LastGenOutput>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.VisualBasic.targets" />
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
<Target Name="BeforeBuild">
|
||||
</Target>
|
||||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
-->
|
||||
</Project>
|
||||
3
CatalogVbLib/Class1.vb
Normal file
3
CatalogVbLib/Class1.vb
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
Public Class Class1
|
||||
|
||||
End Class
|
||||
1068
CatalogVbLib/ExifReader.vb
Normal file
1068
CatalogVbLib/ExifReader.vb
Normal file
File diff suppressed because it is too large
Load diff
13
CatalogVbLib/My Project/Application.Designer.vb
generated
Normal file
13
CatalogVbLib/My Project/Application.Designer.vb
generated
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
'------------------------------------------------------------------------------
|
||||
' <auto-generated>
|
||||
' This code was generated by a tool.
|
||||
' Runtime Version:4.0.30319.34011
|
||||
'
|
||||
' Changes to this file may cause incorrect behavior and will be lost if
|
||||
' the code is regenerated.
|
||||
' </auto-generated>
|
||||
'------------------------------------------------------------------------------
|
||||
|
||||
Option Strict On
|
||||
Option Explicit On
|
||||
|
||||
10
CatalogVbLib/My Project/Application.myapp
Normal file
10
CatalogVbLib/My Project/Application.myapp
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<MyApplicationData xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
|
||||
<MySubMain>false</MySubMain>
|
||||
<SingleInstance>false</SingleInstance>
|
||||
<ShutdownMode>0</ShutdownMode>
|
||||
<EnableVisualStyles>true</EnableVisualStyles>
|
||||
<AuthenticationMode>0</AuthenticationMode>
|
||||
<ApplicationType>1</ApplicationType>
|
||||
<SaveMySettingsOnExit>true</SaveMySettingsOnExit>
|
||||
</MyApplicationData>
|
||||
35
CatalogVbLib/My Project/AssemblyInfo.vb
Normal file
35
CatalogVbLib/My Project/AssemblyInfo.vb
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
Imports System
|
||||
Imports System.Reflection
|
||||
Imports System.Runtime.InteropServices
|
||||
|
||||
' Le informazioni generali relative a un assembly sono controllate dal seguente
|
||||
' insieme di attributi. Per modificare le informazioni associate a un assembly
|
||||
' è necessario modificare i valori di questi attributi.
|
||||
|
||||
' Controllare i valori degli attributi dell'assembly
|
||||
|
||||
<Assembly: AssemblyTitle("CatalogVbLib")>
|
||||
<Assembly: AssemblyDescription("")>
|
||||
<Assembly: AssemblyCompany("")>
|
||||
<Assembly: AssemblyProduct("CatalogVbLib")>
|
||||
<Assembly: AssemblyCopyright("Copyright © 2014")>
|
||||
<Assembly: AssemblyTrademark("")>
|
||||
|
||||
<Assembly: ComVisible(False)>
|
||||
|
||||
'Se il progetto viene esposto a COM, il GUID seguente verrà utilizzato come ID della libreria dei tipi
|
||||
<Assembly: Guid("ed2ef4c1-7f15-469d-9c14-182f2ebc21b5")>
|
||||
|
||||
' Le informazioni sulla versione di un assembly sono costituite dai seguenti quattro valori:
|
||||
'
|
||||
' Numero di versione principale
|
||||
' Numero di versione secondario
|
||||
' Numero build
|
||||
' Revisione
|
||||
'
|
||||
' È possibile specificare tutti i valori oppure impostare valori predefiniti per i numeri relativi alla revisione e alla build
|
||||
' utilizzando l'asterisco (*) come descritto di seguito:
|
||||
' <Assembly: AssemblyVersion("1.0.*")>
|
||||
|
||||
<Assembly: AssemblyVersion("1.0.0.0")>
|
||||
<Assembly: AssemblyFileVersion("1.0.0.0")>
|
||||
62
CatalogVbLib/My Project/Resources.Designer.vb
generated
Normal file
62
CatalogVbLib/My Project/Resources.Designer.vb
generated
Normal file
|
|
@ -0,0 +1,62 @@
|
|||
'------------------------------------------------------------------------------
|
||||
' <auto-generated>
|
||||
' This code was generated by a tool.
|
||||
' Runtime Version:4.0.30319.34011
|
||||
'
|
||||
' Changes to this file may cause incorrect behavior and will be lost if
|
||||
' the code is regenerated.
|
||||
' </auto-generated>
|
||||
'------------------------------------------------------------------------------
|
||||
|
||||
Option Strict On
|
||||
Option Explicit On
|
||||
|
||||
|
||||
Namespace My.Resources
|
||||
|
||||
'This class was auto-generated by the StronglyTypedResourceBuilder
|
||||
'class via a tool like ResGen or Visual Studio.
|
||||
'To add or remove a member, edit your .ResX file then rerun ResGen
|
||||
'with the /str option, or rebuild your VS project.
|
||||
'''<summary>
|
||||
''' A strongly-typed resource class, for looking up localized strings, etc.
|
||||
'''</summary>
|
||||
<Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0"), _
|
||||
Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
|
||||
Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(), _
|
||||
Global.Microsoft.VisualBasic.HideModuleNameAttribute()> _
|
||||
Friend Module Resources
|
||||
|
||||
Private resourceMan As Global.System.Resources.ResourceManager
|
||||
|
||||
Private resourceCulture As Global.System.Globalization.CultureInfo
|
||||
|
||||
'''<summary>
|
||||
''' Returns the cached ResourceManager instance used by this class.
|
||||
'''</summary>
|
||||
<Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _
|
||||
Friend ReadOnly Property ResourceManager() As Global.System.Resources.ResourceManager
|
||||
Get
|
||||
If Object.ReferenceEquals(resourceMan, Nothing) Then
|
||||
Dim temp As Global.System.Resources.ResourceManager = New Global.System.Resources.ResourceManager("CatalogVbLib.Resources", GetType(Resources).Assembly)
|
||||
resourceMan = temp
|
||||
End If
|
||||
Return resourceMan
|
||||
End Get
|
||||
End Property
|
||||
|
||||
'''<summary>
|
||||
''' Overrides the current thread's CurrentUICulture property for all
|
||||
''' resource lookups using this strongly typed resource class.
|
||||
'''</summary>
|
||||
<Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _
|
||||
Friend Property Culture() As Global.System.Globalization.CultureInfo
|
||||
Get
|
||||
Return resourceCulture
|
||||
End Get
|
||||
Set(ByVal value As Global.System.Globalization.CultureInfo)
|
||||
resourceCulture = value
|
||||
End Set
|
||||
End Property
|
||||
End Module
|
||||
End Namespace
|
||||
117
CatalogVbLib/My Project/Resources.resx
Normal file
117
CatalogVbLib/My Project/Resources.resx
Normal file
|
|
@ -0,0 +1,117 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
||||
73
CatalogVbLib/My Project/Settings.Designer.vb
generated
Normal file
73
CatalogVbLib/My Project/Settings.Designer.vb
generated
Normal file
|
|
@ -0,0 +1,73 @@
|
|||
'------------------------------------------------------------------------------
|
||||
' <auto-generated>
|
||||
' This code was generated by a tool.
|
||||
' Runtime Version:4.0.30319.34011
|
||||
'
|
||||
' Changes to this file may cause incorrect behavior and will be lost if
|
||||
' the code is regenerated.
|
||||
' </auto-generated>
|
||||
'------------------------------------------------------------------------------
|
||||
|
||||
Option Strict On
|
||||
Option Explicit On
|
||||
|
||||
|
||||
Namespace My
|
||||
|
||||
<Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(), _
|
||||
Global.System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0"), _
|
||||
Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _
|
||||
Partial Friend NotInheritable Class MySettings
|
||||
Inherits Global.System.Configuration.ApplicationSettingsBase
|
||||
|
||||
Private Shared defaultInstance As MySettings = CType(Global.System.Configuration.ApplicationSettingsBase.Synchronized(New MySettings), MySettings)
|
||||
|
||||
#Region "My.Settings Auto-Save Functionality"
|
||||
#If _MyType = "WindowsForms" Then
|
||||
Private Shared addedHandler As Boolean
|
||||
|
||||
Private Shared addedHandlerLockObject As New Object
|
||||
|
||||
<Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _
|
||||
Private Shared Sub AutoSaveSettings(ByVal sender As Global.System.Object, ByVal e As Global.System.EventArgs)
|
||||
If My.Application.SaveMySettingsOnExit Then
|
||||
My.Settings.Save()
|
||||
End If
|
||||
End Sub
|
||||
#End If
|
||||
#End Region
|
||||
|
||||
Public Shared ReadOnly Property [Default]() As MySettings
|
||||
Get
|
||||
|
||||
#If _MyType = "WindowsForms" Then
|
||||
If Not addedHandler Then
|
||||
SyncLock addedHandlerLockObject
|
||||
If Not addedHandler Then
|
||||
AddHandler My.Application.Shutdown, AddressOf AutoSaveSettings
|
||||
addedHandler = True
|
||||
End If
|
||||
End SyncLock
|
||||
End If
|
||||
#End If
|
||||
Return defaultInstance
|
||||
End Get
|
||||
End Property
|
||||
End Class
|
||||
End Namespace
|
||||
|
||||
Namespace My
|
||||
|
||||
<Global.Microsoft.VisualBasic.HideModuleNameAttribute(), _
|
||||
Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
|
||||
Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute()> _
|
||||
Friend Module MySettingsProperty
|
||||
|
||||
<Global.System.ComponentModel.Design.HelpKeywordAttribute("My.Settings")> _
|
||||
Friend ReadOnly Property Settings() As Global.CatalogVbLib.My.MySettings
|
||||
Get
|
||||
Return Global.CatalogVbLib.My.MySettings.Default
|
||||
End Get
|
||||
End Property
|
||||
End Module
|
||||
End Namespace
|
||||
7
CatalogVbLib/My Project/Settings.settings
Normal file
7
CatalogVbLib/My Project/Settings.settings
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
<?xml version='1.0' encoding='utf-8'?>
|
||||
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" UseMySettingsClassName="true">
|
||||
<Profiles>
|
||||
<Profile Name="(Default)" />
|
||||
</Profiles>
|
||||
<Settings />
|
||||
</SettingsFile>
|
||||
606
CatalogVbLib/PicSettings.vb
Normal file
606
CatalogVbLib/PicSettings.vb
Normal file
|
|
@ -0,0 +1,606 @@
|
|||
Imports System.IO
|
||||
Imports System.Drawing.Drawing2D
|
||||
Imports System.Drawing.Imaging
|
||||
Imports System.Windows.Forms
|
||||
Imports System.Drawing
|
||||
|
||||
Public Module PicSettings
|
||||
|
||||
Private _DirectorySorgente As String
|
||||
Private _DirectoryDestinazione As String
|
||||
|
||||
Private _DimVert As Integer
|
||||
Private _MargVert As Integer
|
||||
|
||||
|
||||
Private _DimStandard As Integer
|
||||
Private _DimStandardMiniatura As Integer
|
||||
|
||||
Private _NomeData As Boolean
|
||||
Private _TestoNome As Boolean
|
||||
Private _UsaOrarioMiniatura As Boolean
|
||||
Private _UsaOrarioTestoApplicare As Boolean
|
||||
Private _UsaTempoGaraTestoApplicare As Boolean
|
||||
Private _TestoFirmaStart As String
|
||||
Private _TestoFirmaStartV As String
|
||||
Private _DataPartenza As DateTime
|
||||
Private _TestoOrario As String
|
||||
|
||||
Private _UsaRotazioneAutomatica As Boolean
|
||||
Private _UsaForzaJpg As Boolean
|
||||
|
||||
Private _LarghezzaSmall As Integer
|
||||
Private _AltezzaSmall As Integer
|
||||
|
||||
Private _CreaMiniature As Boolean
|
||||
Private _AggiungiScritteMiniature As Boolean
|
||||
Private _AggTempoGaraMin As Boolean
|
||||
Private _AggNumTempMin As Boolean
|
||||
|
||||
Private _Suffisso As String
|
||||
Private _Codice As String
|
||||
|
||||
Private _Trasparenza As Integer
|
||||
Private _IlFont As String
|
||||
Private _Grassetto As Boolean
|
||||
|
||||
Private _Posizione As String
|
||||
Private _Allineamento As String
|
||||
Private _Margine As Integer
|
||||
|
||||
Private _LogoAltezza As Integer
|
||||
Private _LogoLarghezza As Integer
|
||||
|
||||
Private _fontColoreRGB As System.Drawing.Color
|
||||
|
||||
Private _LogoAggiungi As Boolean
|
||||
Private _LogoNomeFile As String
|
||||
Private _LogoTrasparenza As String
|
||||
Private _LogoMargine As String
|
||||
Private _LogoPosizioneH As String
|
||||
Private _LogoPosizioneV As String
|
||||
|
||||
Private _FotoGrandeDimOrigina As Boolean
|
||||
Private _AltezzaBig As Integer
|
||||
Private _LarghezzaBig As Integer
|
||||
Private _DestDir As DirectoryInfo
|
||||
Private _DimMin As Integer
|
||||
|
||||
Private _TestoMin As Boolean
|
||||
|
||||
Private _SecretDefault As Boolean
|
||||
Private _SecretBig As Boolean
|
||||
Private _SecretSmall As Boolean
|
||||
|
||||
Private _SecretPathSmall As String
|
||||
Private _SecretPathBig As String
|
||||
|
||||
Private _jpegQuality As Long
|
||||
Private _jpegQualityMin As Long
|
||||
|
||||
Private FotoRuotaADestra As Boolean = False
|
||||
Private FotoRuotaASinistra As Boolean = False
|
||||
|
||||
Private TempMinText As String = ""
|
||||
|
||||
Private _mainForm As Form
|
||||
|
||||
'Private progressBar As System.Windows.Forms.ProgressBar
|
||||
|
||||
|
||||
|
||||
Public Property mainForm() As Form
|
||||
Get
|
||||
Return _mainForm
|
||||
End Get
|
||||
Set(ByVal value As Form)
|
||||
_mainForm = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property DirectorySorgente() As String
|
||||
Get
|
||||
Return _DirectorySorgente
|
||||
End Get
|
||||
Set(ByVal value As String)
|
||||
_DirectorySorgente = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property DirectoryDestinazione() As String
|
||||
Get
|
||||
Return _DirectoryDestinazione
|
||||
End Get
|
||||
Set(ByVal value As String)
|
||||
_DirectoryDestinazione = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property TestoFirmaStart() As String
|
||||
Get
|
||||
Return _TestoFirmaStart
|
||||
End Get
|
||||
Set(ByVal value As String)
|
||||
_TestoFirmaStart = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property TestoFirmaStartV() As String
|
||||
Get
|
||||
Return _TestoFirmaStartV
|
||||
End Get
|
||||
|
||||
Set(ByVal value As String)
|
||||
_TestoFirmaStartV = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property DataPartenza() As DateTime
|
||||
Get
|
||||
Return _DataPartenza
|
||||
End Get
|
||||
Set(ByVal value As DateTime)
|
||||
_DataPartenza = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property TestoOrario() As String
|
||||
Get
|
||||
Return _TestoOrario
|
||||
End Get
|
||||
Set(ByVal value As String)
|
||||
_TestoOrario = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property DimStandard() As Integer
|
||||
Get
|
||||
Return _DimStandard
|
||||
End Get
|
||||
Set(ByVal value As Integer)
|
||||
_DimStandard = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property DimStandardMiniatura() As Integer
|
||||
Get
|
||||
Return _DimStandardMiniatura
|
||||
End Get
|
||||
Set(ByVal value As Integer)
|
||||
_DimStandardMiniatura = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property NomeData() As Boolean
|
||||
Get
|
||||
Return _NomeData
|
||||
End Get
|
||||
Set(ByVal value As Boolean)
|
||||
_NomeData = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property TestoNome() As Boolean
|
||||
Get
|
||||
Return _TestoNome
|
||||
End Get
|
||||
Set(ByVal value As Boolean)
|
||||
_TestoNome = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property UsaOrarioMiniatura() As Boolean
|
||||
Get
|
||||
Return _UsaOrarioMiniatura
|
||||
End Get
|
||||
Set(ByVal value As Boolean)
|
||||
_UsaOrarioMiniatura = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property UsaOrarioTestoApplicare() As Boolean
|
||||
Get
|
||||
Return _UsaOrarioTestoApplicare
|
||||
End Get
|
||||
Set(ByVal value As Boolean)
|
||||
_UsaOrarioTestoApplicare = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property UsaTempoGaraTestoApplicare() As Boolean
|
||||
Get
|
||||
Return _UsaTempoGaraTestoApplicare
|
||||
End Get
|
||||
Set(ByVal value As Boolean)
|
||||
_UsaTempoGaraTestoApplicare = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property UsaRotazioneAutomatica() As Boolean
|
||||
Get
|
||||
Return _UsaRotazioneAutomatica
|
||||
End Get
|
||||
Set(ByVal value As Boolean)
|
||||
_UsaRotazioneAutomatica = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property UsaForzaJpg() As Boolean
|
||||
Get
|
||||
Return _UsaForzaJpg
|
||||
End Get
|
||||
Set(ByVal value As Boolean)
|
||||
_UsaForzaJpg = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
|
||||
Public Property LarghezzaSmall() As Integer
|
||||
Get
|
||||
Return _LarghezzaSmall
|
||||
End Get
|
||||
Set(ByVal value As Integer)
|
||||
_LarghezzaSmall = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property AltezzaSmall() As Integer
|
||||
Get
|
||||
Return _AltezzaSmall
|
||||
End Get
|
||||
Set(ByVal value As Integer)
|
||||
_AltezzaSmall = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property CreaMiniature() As Boolean
|
||||
Get
|
||||
Return _CreaMiniature
|
||||
End Get
|
||||
Set(ByVal value As Boolean)
|
||||
_CreaMiniature = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property AggiungiScritteMiniature() As Boolean
|
||||
Get
|
||||
Return _AggiungiScritteMiniature
|
||||
End Get
|
||||
Set(ByVal value As Boolean)
|
||||
_AggiungiScritteMiniature = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property Suffisso() As String
|
||||
Get
|
||||
Return _Suffisso
|
||||
End Get
|
||||
Set(ByVal value As String)
|
||||
_Suffisso = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property Codice() As String
|
||||
Get
|
||||
Return _Codice
|
||||
End Get
|
||||
Set(ByVal value As String)
|
||||
_Codice = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property Trasparenza() As Integer
|
||||
Get
|
||||
Return _Trasparenza
|
||||
End Get
|
||||
Set(ByVal value As Integer)
|
||||
_Trasparenza = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property IlFont() As String
|
||||
Get
|
||||
Return _IlFont
|
||||
End Get
|
||||
Set(ByVal value As String)
|
||||
_IlFont = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property Grassetto() As Boolean
|
||||
Get
|
||||
Return _Grassetto
|
||||
End Get
|
||||
Set(ByVal value As Boolean)
|
||||
_Grassetto = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property Posizione() As String
|
||||
Get
|
||||
Return _Posizione
|
||||
End Get
|
||||
Set(ByVal value As String)
|
||||
_Posizione = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property Allineamento() As String
|
||||
Get
|
||||
Return _Allineamento
|
||||
End Get
|
||||
Set(ByVal value As String)
|
||||
_Allineamento = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property Margine() As Integer
|
||||
Get
|
||||
Return _Margine
|
||||
End Get
|
||||
Set(ByVal value As Integer)
|
||||
_Margine = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property LogoAltezza() As Integer
|
||||
Get
|
||||
Return _LogoAltezza
|
||||
End Get
|
||||
Set(ByVal value As Integer)
|
||||
_LogoAltezza = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property LogoLarghezza() As Integer
|
||||
Get
|
||||
Return _LogoLarghezza
|
||||
End Get
|
||||
Set(ByVal value As Integer)
|
||||
_LogoLarghezza = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property fontColoreRGB() As Color
|
||||
Get
|
||||
Return _fontColoreRGB
|
||||
End Get
|
||||
Set(ByVal value As Color)
|
||||
_fontColoreRGB = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property LogoAggiungi() As Boolean
|
||||
Get
|
||||
Return _LogoAggiungi
|
||||
End Get
|
||||
Set(ByVal value As Boolean)
|
||||
_LogoAggiungi = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property LogoNomeFile() As String
|
||||
Get
|
||||
Return _LogoNomeFile
|
||||
End Get
|
||||
Set(ByVal value As String)
|
||||
_LogoNomeFile = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property LogoTrasparenza() As String
|
||||
Get
|
||||
Return _LogoTrasparenza
|
||||
End Get
|
||||
Set(ByVal value As String)
|
||||
_LogoTrasparenza = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property LogoMargine() As String
|
||||
Get
|
||||
Return _LogoMargine
|
||||
End Get
|
||||
Set(ByVal value As String)
|
||||
_LogoMargine = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property LogoPosizioneH() As String
|
||||
Get
|
||||
Return _LogoPosizioneH
|
||||
End Get
|
||||
Set(ByVal value As String)
|
||||
_LogoPosizioneH = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property LogoPosizioneV() As String
|
||||
Get
|
||||
Return _LogoPosizioneV
|
||||
End Get
|
||||
Set(ByVal value As String)
|
||||
_LogoPosizioneV = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property FotoGrandeDimOrigina() As Boolean
|
||||
Get
|
||||
Return _FotoGrandeDimOrigina
|
||||
End Get
|
||||
Set(ByVal value As Boolean)
|
||||
_FotoGrandeDimOrigina = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property AltezzaBig() As Integer
|
||||
Get
|
||||
Return _AltezzaBig
|
||||
End Get
|
||||
Set(ByVal value As Integer)
|
||||
_AltezzaBig = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property LarghezzaBig() As Integer
|
||||
Get
|
||||
Return _LarghezzaBig
|
||||
End Get
|
||||
Set(ByVal value As Integer)
|
||||
_LarghezzaBig = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property DestDir() As DirectoryInfo
|
||||
Get
|
||||
Return _DestDir
|
||||
End Get
|
||||
Set(ByVal value As DirectoryInfo)
|
||||
_DestDir = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property DimVert() As Integer
|
||||
Get
|
||||
Return _DimVert
|
||||
|
||||
End Get
|
||||
Set(ByVal value As Integer)
|
||||
_DimVert = value
|
||||
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property MargVert() As Integer
|
||||
Get
|
||||
Return _MargVert
|
||||
|
||||
End Get
|
||||
Set(ByVal value As Integer)
|
||||
_MargVert = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property TestoMin() As Boolean
|
||||
Get
|
||||
Return _TestoMin
|
||||
|
||||
End Get
|
||||
Set(ByVal value As Boolean)
|
||||
_TestoMin = value
|
||||
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property DimMin() As Integer
|
||||
Get
|
||||
Return _DimMin
|
||||
|
||||
End Get
|
||||
Set(ByVal value As Integer)
|
||||
_DimMin = value
|
||||
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property SecretDefault() As Boolean
|
||||
Get
|
||||
Return _SecretDefault
|
||||
|
||||
End Get
|
||||
Set(ByVal value As Boolean)
|
||||
_SecretDefault = value
|
||||
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property SecretBig() As Boolean
|
||||
Get
|
||||
Return _SecretBig
|
||||
|
||||
End Get
|
||||
Set(ByVal value As Boolean)
|
||||
_SecretBig = value
|
||||
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property SecretSmall() As Boolean
|
||||
Get
|
||||
Return _SecretSmall
|
||||
|
||||
End Get
|
||||
Set(ByVal value As Boolean)
|
||||
_SecretSmall = value
|
||||
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property SecretPathSmall() As String
|
||||
Get
|
||||
Return _SecretPathSmall
|
||||
|
||||
End Get
|
||||
Set(ByVal value As String)
|
||||
_SecretPathSmall = value
|
||||
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property SecretPathBig() As String
|
||||
Get
|
||||
Return _SecretPathBig
|
||||
|
||||
End Get
|
||||
Set(ByVal value As String)
|
||||
_SecretPathBig = value
|
||||
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property AggTempoGaraMin() As Boolean
|
||||
Get
|
||||
Return _AggTempoGaraMin
|
||||
|
||||
End Get
|
||||
Set(ByVal value As Boolean)
|
||||
_AggTempoGaraMin = value
|
||||
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property AggNumTempMin() As Boolean
|
||||
Get
|
||||
Return _AggNumTempMin
|
||||
|
||||
End Get
|
||||
Set(ByVal value As Boolean)
|
||||
_AggNumTempMin = value
|
||||
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property jpegQuality() As Long
|
||||
Get
|
||||
Return _jpegQuality
|
||||
End Get
|
||||
Set(ByVal value As Long)
|
||||
_jpegQuality = value
|
||||
End Set
|
||||
|
||||
End Property
|
||||
|
||||
Public Property jpegQualityMin() As Long
|
||||
Get
|
||||
Return _jpegQualityMin
|
||||
End Get
|
||||
Set(ByVal value As Long)
|
||||
_jpegQualityMin = value
|
||||
End Set
|
||||
|
||||
End Property
|
||||
End Module
|
||||
101
ImageCatalogCS/AboutForm.Designer.cs
generated
Normal file
101
ImageCatalogCS/AboutForm.Designer.cs
generated
Normal file
|
|
@ -0,0 +1,101 @@
|
|||
namespace ImageCatalogCS
|
||||
{
|
||||
partial class AboutForm
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Windows Form Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(AboutForm));
|
||||
this.label1 = new System.Windows.Forms.Label();
|
||||
this.label2 = new System.Windows.Forms.Label();
|
||||
this.button1 = new System.Windows.Forms.Button();
|
||||
this.pictureBox1 = new System.Windows.Forms.PictureBox();
|
||||
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// label1
|
||||
//
|
||||
this.label1.AutoSize = true;
|
||||
this.label1.Location = new System.Drawing.Point(12, 213);
|
||||
this.label1.Name = "label1";
|
||||
this.label1.Size = new System.Drawing.Size(75, 13);
|
||||
this.label1.TabIndex = 0;
|
||||
this.label1.Text = "Image Catalog";
|
||||
//
|
||||
// label2
|
||||
//
|
||||
this.label2.AutoSize = true;
|
||||
this.label2.Location = new System.Drawing.Point(350, 213);
|
||||
this.label2.Name = "label2";
|
||||
this.label2.Size = new System.Drawing.Size(66, 13);
|
||||
this.label2.TabIndex = 1;
|
||||
this.label2.Text = "Versione 3.0";
|
||||
//
|
||||
// button1
|
||||
//
|
||||
this.button1.Location = new System.Drawing.Point(176, 239);
|
||||
this.button1.Name = "button1";
|
||||
this.button1.Size = new System.Drawing.Size(75, 23);
|
||||
this.button1.TabIndex = 2;
|
||||
this.button1.Text = "Chiudi";
|
||||
this.button1.UseVisualStyleBackColor = true;
|
||||
this.button1.Click += new System.EventHandler(this.button1_Click);
|
||||
//
|
||||
// pictureBox1
|
||||
//
|
||||
this.pictureBox1.Image = ((System.Drawing.Image)(resources.GetObject("pictureBox1.Image")));
|
||||
this.pictureBox1.InitialImage = ((System.Drawing.Image)(resources.GetObject("pictureBox1.InitialImage")));
|
||||
this.pictureBox1.Location = new System.Drawing.Point(15, 13);
|
||||
this.pictureBox1.Name = "pictureBox1";
|
||||
this.pictureBox1.Size = new System.Drawing.Size(401, 197);
|
||||
this.pictureBox1.TabIndex = 3;
|
||||
this.pictureBox1.TabStop = false;
|
||||
//
|
||||
// AboutForm
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(433, 274);
|
||||
this.Controls.Add(this.pictureBox1);
|
||||
this.Controls.Add(this.button1);
|
||||
this.Controls.Add(this.label2);
|
||||
this.Controls.Add(this.label1);
|
||||
this.Name = "AboutForm";
|
||||
this.Text = "AboutForm";
|
||||
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.Label label1;
|
||||
private System.Windows.Forms.Label label2;
|
||||
private System.Windows.Forms.Button button1;
|
||||
private System.Windows.Forms.PictureBox pictureBox1;
|
||||
}
|
||||
}
|
||||
25
ImageCatalogCS/AboutForm.cs
Normal file
25
ImageCatalogCS/AboutForm.cs
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace ImageCatalogCS
|
||||
{
|
||||
public partial class AboutForm : Form
|
||||
{
|
||||
public AboutForm()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void button1_Click(object sender, EventArgs e)
|
||||
{
|
||||
this.Close();
|
||||
}
|
||||
}
|
||||
}
|
||||
229
ImageCatalogCS/AboutForm.resx
Normal file
229
ImageCatalogCS/AboutForm.resx
Normal file
|
|
@ -0,0 +1,229 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
|
||||
<data name="pictureBox1.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>
|
||||
iVBORw0KGgoAAAANSUhEUgAAAZ4AAADQCAIAAAC4O5DwAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAS
|
||||
cwAAEnMBjCK5BwAAC05JREFUeF7t2sGBG0cORmEn4PPmooCUxO7FGTgaJ+NgtE0OKZMeTTdQDVQBf7/v
|
||||
4svuDLsK9boo6bcfACCHtAEQRNoACCJtAASRNgCCSBsAQaQNgCDSBkAQaQMgiLQBEETaAAgibQAEkTYA
|
||||
gkgbAEGkDYAg0gZAEGkDIIi0ARBE2gAIIm0ABJE2AIJIGwBBpA2AINIGQBBpAyCItAEQRNoACCJtAASR
|
||||
NgCCSBsAQaQNgCDSBkAQaQMgiLQBEETaAAgibQAEkTYAgkgbAEGkDYAg0pbqr++/Dfn259+PnwBhjEci
|
||||
0hZndFBtvv/1+DXoifGYi7SdkzuvX+Gt3QTjsQ5pG/H3n98eU7QaL+uCGI8KSJtHnZn9NxJXAONRCWkz
|
||||
qTu0b/gmsgbjUdDKtB0PRIG9aDK1r1asmvsPlUSO2cXGo8WRfViXNsNQLL5GNxzbF3MX74Jpu+Z4HG90
|
||||
lZ1dlTbLXCwsW+7YHm5+2F+sTVvCa6UtvWr7q7N0PAy/vMberkmbZTSWrU/Y4OxyTtWJDzUlb9dJ25zx
|
||||
2Hj2beZ4lD68L1akzfTOm3IgP5k2tzeD+z9yZUgftWukbep4bEYWacJ4WJZh/f7OT5tt6ReUbfbc3px6
|
||||
TOcQpy6pftpWjMdmfNcSx8O0Fqt3eHbabOs9fVVGXnUxAh7Vfujy1lU7bevGY3N2pTLGo+gxfjM5bbZl
|
||||
nrwkSwd3E3Odsk5wzuVNOG3G8fjP478ZAvYsejxsPy9n2Gymps24vFPXwzS4vz/+myTumNuOYcICq6bN
|
||||
tKDf/vff5Jdj0GpFjkfFw/xmYtqMb7+ZM2/5SN//sJ7az7toPvChD234reGLLJk203hsm25++BITEjUe
|
||||
Bc/zm2lpMy7EzJU43uNtFE2fe/9DW8Y3+rGPP3bsbzQf0adlE29mGo9NxwkJGY+CR/rVrLRZR3/aMhzu
|
||||
i3VuTZ/YMAWf3+hnHa554K9US5txPCz/y6oTEjAe1l2Pn22DOWkz7NuHWWtwtCfPz2Gf8ENHPyrlrB/9
|
||||
0rD11kqbdTw2rSfk9HhYt33Fbk9Jm3nuw07avv3P87INsWU4+GlZ229+2jPMW/y0YtiNPAvWf0LOjYd5
|
||||
3ycd7RcT0na0+z/Nmfb9j/P+GaKrsP/z8nZ/9/eGLLt5xJ/mbLafZzw2EhNyZjyKne4X+WkzD/2UZ9/d
|
||||
iX9/gv1tG5mzM0N0iuu5B5h3+Wn6pJt4l0llQk6Mx/4SvJp8cctOm/3BC876iQ3/QvxRKEIkbV5MSN0j
|
||||
npw2+8RXHPWEN+jujyRt3TAhG3vbpn7+1LQVfWYzBteMtH12nQmx7/7Ebc9MW/ey7T/A0CbtLwlp64YJ
|
||||
+eDY/mmPkJi2io/rEz9mu2vS+bSTtl+40IQUPOx5aetftqNn8A/a/s8ruwwGjt3+oJE2JuTJMQCTtj4r
|
||||
bfuvs3d1N+zoKXyf/OCntT7sV00bE/JUrm1JadMom+E57B8+8EcV5E7bh9bPfMeEPFVrW07aPINe+/V9
|
||||
3GjT5z/+Mc1P+WDafur79EzIk2cGJjxLStp0ymYauaOHsCxH9WU4cjZtH1quAhPyYFqIp/y2ZaRNqWwb
|
||||
8+N83i3z/7V72YLSdtdvLZiQD7XalpA2z5S3GGPXjo1oH7bQtN1N+MISiAn5UKpt8WlzDXmTCc4d3V7H
|
||||
+Nei03bTaV2YkLtKhz88bYpl26SNrsCN7SYjbZtGq8OE3BQ6/tFpcz1ar2OdcXo7XUx2JaVt02hImBBn
|
||||
4FMfLjhtwmXbBL+Y2z3/jry0bS57uW84IXXaFpu2Qs3OEnWGWz7811LT1uuMX3xCytxuQtPmK1vbS8vp
|
||||
V7PSde0hOW3N1uzKE1ImAqFp881373vL6FkWu609paet33G/6oRUqUBk2nzPJHF18TyyaNQ+TEhbz5G5
|
||||
3oQ4r6xpDx2Ytot8Hf21rydY7EG/8Hz+naeNqF/jw3+dCfFtdNrTB6bN90TSdxh87dyfQ13jRdFbkWtb
|
||||
XNoufWmDz4kbHO/E8py7m7SjcWkrcg1FE8N1o23VOa9tSS0IS1uRWyj6GP1qymuxuhLXtrC0cWmD39jV
|
||||
jekprsS1LSptXNowYuzmxvgUV+HaFpW2EldQNDR0cWN+ahNKW4kbKFoaaRsDVFuFHgSlzTmeTCb+Qdvk
|
||||
eP+cIePatiZtfJ/Ai5G2MUKlFQhCTNoqRBptjfxdAte20gp8jVuSNsYSb0baxuuxsgJFIG0oYOArKWmr
|
||||
zPuyStjNmLQVuH6is4G0MUSVXTVtvHDxbuAbKWmrjLQBd3wjFbM+CaQNFZA2Mc4NTbiDkzZUQNrEkDbg
|
||||
hrSJIW3ADWkTsz4JpA0V+NPG35CWRtqAG9KmhX+yC9wM/Ls23o+VOTc0owgxaSvwIOiMtIkhbcAN30fF
|
||||
OIuQ8Z6KSRt/2IYzuLSpKRAE0ob1uLSp8e1oym4GpY1vpFfyc7eDXlH+svFyrK1CD4LSVqHSyPLl5sbs
|
||||
I2WTU+CP2sLSVuFZEMOxlxFtGygbr8biKtx0otLmfBjSVtGKyDjfiXeUrbgSF52wtPmehuEsaX7bBn4j
|
||||
w1NeiRiEpY1rm4LJd6iRsDE69ZVoQVzauLYpGGnb4GYO/SrK1kCNFMSljWubhMHgeOdz6L624ZXYQI0S
|
||||
BKaNa5uG0epYt3Qwnne8EBvwbXDalgamrcoj4aQz7dl8WbjhZj7xOmzBtc95exqZtirPhLNORygDA9ND
|
||||
lRtOaNq4tskoFzfC1oVrdBIjEJo2X9sY1tJKxY1ZaaNMA2LT5nsurm21+S7hiRiURjyvxNQ3VnDaytxG
|
||||
EaLA1Y0LWyt1AhCdtjrRRoi1VzcmpJlCX9vC0+ZqG9e2DlbVjenop9Dpj08bbVM0O29c11qqdPYT0uZ5
|
||||
Pia4kVl5433XlWdC0nc5I220TVhu36haZ57ZyD/4KWnztI1h7ig8cLziBNQ69jlpo20XcTpxJE1HsUOf
|
||||
lDbHYzLcKoydY8M1OV5zU64zWWmjbcCVVCtbXtocj0rbgObKlS0xbbStiN19EF76qz73EgUPe2LaHF9K
|
||||
GbRU+3Onufi7s8e8RSt41FPTRtvK2N8JteW/1tMWYD7oE/89RG7a7PdUxi3b0fRNHLpURyOn8pyVVCxb
|
||||
dtrsT03b0h2+Z/qf+sNpI2wJap7x9LTRtkqON6Pv2T/+hsCIZTB/M5s8WvlpMz86gzeDZTf65c3w/mS8
|
||||
cpQ93hPSZr+48W1hCtMwtimB7WgxWkmsZZu/AVPSVvj5L8q4IcX7xitzOeMWrBikOWkrvQQXZX3dlCyD
|
||||
NWpMVC7jPiyZoFlpE7kniLEXosjO2Ht8x3UtVe0zPS1t5oVgHOfy5O1mxaA6i3bHSzJb8QM9MW3WU0Tb
|
||||
pvPm7SG3HoMf6oYRmqD6aZ6aNmPned+uMHIz+mx4kk+E7B1Zm8O0YSuP8ty0GQ8QbVslpm+rULVpbIOy
|
||||
dENmp81Ye4Z0oYZ942U4V4dDPD9ttnVhVldrEjgGZT7TaCy/naxImy1uXNxKqFs4BmQRy0gUeOOsSZsp
|
||||
boxuJXUSx1ysZTi6Ja7Sq9JmWSG+a5RkuXLHYxhqMLziimzVurRZzggv6OJyM8f2l9PoQrIybVA0Wjuu
|
||||
ZQhF2gAIIm0ABJE2AIJIGwBBpA2AINIGQBBpAyCItAEQRNoACCJtAASRNgCCSBsAQaQNgCDSBkAQaQMg
|
||||
iLQBEETaAAgibQAEkTYAgkgbAEGkDYAg0gZAEGkDIIi0ARBE2gAIIm0ABJE2AIJIGwBBpA2AINIGQBBp
|
||||
AyCItAEQRNoACCJtAASRNgCCSBsAQaQNgCDSBkAQaQMgiLQBEETaAAgibQAEkTYAgkgbAEGkDYAg0gZA
|
||||
EGkDIIi0ARBE2gAIIm0ABJE2AIJIGwA5P378HyuEmb0husDDAAAAAElFTkSuQmCC
|
||||
</value>
|
||||
</data>
|
||||
<data name="pictureBox1.InitialImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>
|
||||
iVBORw0KGgoAAAANSUhEUgAAAZ4AAADQCAIAAAC4O5DwAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAS
|
||||
cwAAEnMBjCK5BwAAC05JREFUeF7t2sGBG0cORmEn4PPmooCUxO7FGTgaJ+NgtE0OKZMeTTdQDVQBf7/v
|
||||
4svuDLsK9boo6bcfACCHtAEQRNoACCJtAASRNgCCSBsAQaQNgCDSBkAQaQMgiLQBEETaAAgibQAEkTYA
|
||||
gkgbAEGkDYAg0gZAEGkDIIi0ARBE2gAIIm0ABJE2AIJIGwBBpA2AINIGQBBpAyCItAEQRNoACCJtAASR
|
||||
NgCCSBsAQaQNgCDSBkAQaQMgiLQBEETaAAgibQAEkTYAgkgbAEGkDYAg0pbqr++/Dfn259+PnwBhjEci
|
||||
0hZndFBtvv/1+DXoifGYi7SdkzuvX+Gt3QTjsQ5pG/H3n98eU7QaL+uCGI8KSJtHnZn9NxJXAONRCWkz
|
||||
qTu0b/gmsgbjUdDKtB0PRIG9aDK1r1asmvsPlUSO2cXGo8WRfViXNsNQLL5GNxzbF3MX74Jpu+Z4HG90
|
||||
lZ1dlTbLXCwsW+7YHm5+2F+sTVvCa6UtvWr7q7N0PAy/vMberkmbZTSWrU/Y4OxyTtWJDzUlb9dJ25zx
|
||||
2Hj2beZ4lD68L1akzfTOm3IgP5k2tzeD+z9yZUgftWukbep4bEYWacJ4WJZh/f7OT5tt6ReUbfbc3px6
|
||||
TOcQpy6pftpWjMdmfNcSx8O0Fqt3eHbabOs9fVVGXnUxAh7Vfujy1lU7bevGY3N2pTLGo+gxfjM5bbZl
|
||||
nrwkSwd3E3Odsk5wzuVNOG3G8fjP478ZAvYsejxsPy9n2Gymps24vFPXwzS4vz/+myTumNuOYcICq6bN
|
||||
tKDf/vff5Jdj0GpFjkfFw/xmYtqMb7+ZM2/5SN//sJ7az7toPvChD234reGLLJk203hsm25++BITEjUe
|
||||
Bc/zm2lpMy7EzJU43uNtFE2fe/9DW8Y3+rGPP3bsbzQf0adlE29mGo9NxwkJGY+CR/rVrLRZR3/aMhzu
|
||||
i3VuTZ/YMAWf3+hnHa554K9US5txPCz/y6oTEjAe1l2Pn22DOWkz7NuHWWtwtCfPz2Gf8ENHPyrlrB/9
|
||||
0rD11kqbdTw2rSfk9HhYt33Fbk9Jm3nuw07avv3P87INsWU4+GlZ229+2jPMW/y0YtiNPAvWf0LOjYd5
|
||||
3ycd7RcT0na0+z/Nmfb9j/P+GaKrsP/z8nZ/9/eGLLt5xJ/mbLafZzw2EhNyZjyKne4X+WkzD/2UZ9/d
|
||||
iX9/gv1tG5mzM0N0iuu5B5h3+Wn6pJt4l0llQk6Mx/4SvJp8cctOm/3BC876iQ3/QvxRKEIkbV5MSN0j
|
||||
npw2+8RXHPWEN+jujyRt3TAhG3vbpn7+1LQVfWYzBteMtH12nQmx7/7Ebc9MW/ey7T/A0CbtLwlp64YJ
|
||||
+eDY/mmPkJi2io/rEz9mu2vS+bSTtl+40IQUPOx5aetftqNn8A/a/s8ruwwGjt3+oJE2JuTJMQCTtj4r
|
||||
bfuvs3d1N+zoKXyf/OCntT7sV00bE/JUrm1JadMom+E57B8+8EcV5E7bh9bPfMeEPFVrW07aPINe+/V9
|
||||
3GjT5z/+Mc1P+WDafur79EzIk2cGJjxLStp0ymYauaOHsCxH9WU4cjZtH1quAhPyYFqIp/y2ZaRNqWwb
|
||||
8+N83i3z/7V72YLSdtdvLZiQD7XalpA2z5S3GGPXjo1oH7bQtN1N+MISiAn5UKpt8WlzDXmTCc4d3V7H
|
||||
+Nei03bTaV2YkLtKhz88bYpl26SNrsCN7SYjbZtGq8OE3BQ6/tFpcz1ar2OdcXo7XUx2JaVt02hImBBn
|
||||
4FMfLjhtwmXbBL+Y2z3/jry0bS57uW84IXXaFpu2Qs3OEnWGWz7811LT1uuMX3xCytxuQtPmK1vbS8vp
|
||||
V7PSde0hOW3N1uzKE1ImAqFp881373vL6FkWu609paet33G/6oRUqUBk2nzPJHF18TyyaNQ+TEhbz5G5
|
||||
3oQ4r6xpDx2Ytot8Hf21rydY7EG/8Hz+naeNqF/jw3+dCfFtdNrTB6bN90TSdxh87dyfQ13jRdFbkWtb
|
||||
XNoufWmDz4kbHO/E8py7m7SjcWkrcg1FE8N1o23VOa9tSS0IS1uRWyj6GP1qymuxuhLXtrC0cWmD39jV
|
||||
jekprsS1LSptXNowYuzmxvgUV+HaFpW2EldQNDR0cWN+ahNKW4kbKFoaaRsDVFuFHgSlzTmeTCb+Qdvk
|
||||
eP+cIePatiZtfJ/Ai5G2MUKlFQhCTNoqRBptjfxdAte20gp8jVuSNsYSb0baxuuxsgJFIG0oYOArKWmr
|
||||
zPuyStjNmLQVuH6is4G0MUSVXTVtvHDxbuAbKWmrjLQBd3wjFbM+CaQNFZA2Mc4NTbiDkzZUQNrEkDbg
|
||||
hrSJIW3ADWkTsz4JpA0V+NPG35CWRtqAG9KmhX+yC9wM/Ls23o+VOTc0owgxaSvwIOiMtIkhbcAN30fF
|
||||
OIuQ8Z6KSRt/2IYzuLSpKRAE0ob1uLSp8e1oym4GpY1vpFfyc7eDXlH+svFyrK1CD4LSVqHSyPLl5sbs
|
||||
I2WTU+CP2sLSVuFZEMOxlxFtGygbr8biKtx0otLmfBjSVtGKyDjfiXeUrbgSF52wtPmehuEsaX7bBn4j
|
||||
w1NeiRiEpY1rm4LJd6iRsDE69ZVoQVzauLYpGGnb4GYO/SrK1kCNFMSljWubhMHgeOdz6L624ZXYQI0S
|
||||
BKaNa5uG0epYt3Qwnne8EBvwbXDalgamrcoj4aQz7dl8WbjhZj7xOmzBtc95exqZtirPhLNORygDA9ND
|
||||
lRtOaNq4tskoFzfC1oVrdBIjEJo2X9sY1tJKxY1ZaaNMA2LT5nsurm21+S7hiRiURjyvxNQ3VnDaytxG
|
||||
EaLA1Y0LWyt1AhCdtjrRRoi1VzcmpJlCX9vC0+ZqG9e2DlbVjenop9Dpj08bbVM0O29c11qqdPYT0uZ5
|
||||
Pia4kVl5433XlWdC0nc5I220TVhu36haZ57ZyD/4KWnztI1h7ig8cLziBNQ69jlpo20XcTpxJE1HsUOf
|
||||
lDbHYzLcKoydY8M1OV5zU64zWWmjbcCVVCtbXtocj0rbgObKlS0xbbStiN19EF76qz73EgUPe2LaHF9K
|
||||
GbRU+3Onufi7s8e8RSt41FPTRtvK2N8JteW/1tMWYD7oE/89RG7a7PdUxi3b0fRNHLpURyOn8pyVVCxb
|
||||
dtrsT03b0h2+Z/qf+sNpI2wJap7x9LTRtkqON6Pv2T/+hsCIZTB/M5s8WvlpMz86gzeDZTf65c3w/mS8
|
||||
cpQ93hPSZr+48W1hCtMwtimB7WgxWkmsZZu/AVPSVvj5L8q4IcX7xitzOeMWrBikOWkrvQQXZX3dlCyD
|
||||
NWpMVC7jPiyZoFlpE7kniLEXosjO2Ht8x3UtVe0zPS1t5oVgHOfy5O1mxaA6i3bHSzJb8QM9MW3WU0Tb
|
||||
pvPm7SG3HoMf6oYRmqD6aZ6aNmPned+uMHIz+mx4kk+E7B1Zm8O0YSuP8ty0GQ8QbVslpm+rULVpbIOy
|
||||
dENmp81Ye4Z0oYZ942U4V4dDPD9ttnVhVldrEjgGZT7TaCy/naxImy1uXNxKqFs4BmQRy0gUeOOsSZsp
|
||||
boxuJXUSx1ysZTi6Ja7Sq9JmWSG+a5RkuXLHYxhqMLziimzVurRZzggv6OJyM8f2l9PoQrIybVA0Wjuu
|
||||
ZQhF2gAIIm0ABJE2AIJIGwBBpA2AINIGQBBpAyCItAEQRNoACCJtAASRNgCCSBsAQaQNgCDSBkAQaQMg
|
||||
iLQBEETaAAgibQAEkTYAgkgbAEGkDYAg0gZAEGkDIIi0ARBE2gAIIm0ABJE2AIJIGwBBpA2AINIGQBBp
|
||||
AyCItAEQRNoACCJtAASRNgCCSBsAQaQNgCDSBkAQaQMgiLQBEETaAAgibQAEkTYAgkgbAEGkDYAg0gZA
|
||||
EGkDIIi0ARBE2gAIIm0ABJE2AIJIGwA5P378HyuEmb0husDDAAAAAElFTkSuQmCC
|
||||
</value>
|
||||
</data>
|
||||
</root>
|
||||
6
ImageCatalogCS/App.config
Normal file
6
ImageCatalogCS/App.config
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<configuration>
|
||||
<startup>
|
||||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
|
||||
</startup>
|
||||
</configuration>
|
||||
12
ImageCatalogCS/CreaImmagineSeparateThread.cs
Normal file
12
ImageCatalogCS/CreaImmagineSeparateThread.cs
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ImageCatalogCS
|
||||
{
|
||||
class CreaImmagineSeparateThread
|
||||
{
|
||||
}
|
||||
}
|
||||
1166
ImageCatalogCS/ExifReader.cs
Normal file
1166
ImageCatalogCS/ExifReader.cs
Normal file
File diff suppressed because it is too large
Load diff
173
ImageCatalogCS/FileHelper.cs
Normal file
173
ImageCatalogCS/FileHelper.cs
Normal file
|
|
@ -0,0 +1,173 @@
|
|||
using Microsoft.VisualBasic;
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
|
||||
public class FileHelper
|
||||
{
|
||||
//Private dirSourceDest As Dictionary(Of FileInfo, DirectoryInfo)
|
||||
private int filesPerFolder;
|
||||
private string suffix;
|
||||
private int counterSize;
|
||||
private int numerationType;
|
||||
private string filter;
|
||||
private bool separateFiles;
|
||||
|
||||
private string extensions = "*.jpg,*.png,*.gif";
|
||||
|
||||
public enum numerazione
|
||||
{
|
||||
Progressiva,
|
||||
Files
|
||||
}
|
||||
/// <summary>
|
||||
/// Preparazione per la separazione
|
||||
/// </summary>
|
||||
/// <param name="filesPerFolder"></param>
|
||||
/// <param name="suffix"></param>
|
||||
/// <param name="counterSize"></param>
|
||||
/// <param name="numerationType"></param>
|
||||
/// <remarks></remarks>
|
||||
public FileHelper(int filesPerFolder, string suffix, int counterSize, int numerationType)
|
||||
{
|
||||
this.filesPerFolder = filesPerFolder;
|
||||
this.suffix = suffix;
|
||||
this.counterSize = counterSize;
|
||||
this.numerationType = numerationType;
|
||||
this.separateFiles = true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// nessuna separazione
|
||||
/// </summary>
|
||||
/// <remarks></remarks>
|
||||
public FileHelper()
|
||||
{
|
||||
this.separateFiles = false;
|
||||
}
|
||||
|
||||
|
||||
public Dictionary<FileInfo, DirectoryInfo> GetFilesRecursive(DirectoryInfo root, DirectoryInfo destRoot, string filter)
|
||||
{
|
||||
Dictionary<FileInfo, DirectoryInfo> dirSourceDest = new Dictionary<FileInfo, DirectoryInfo>();
|
||||
List<FileInfo> result = new List<FileInfo>();
|
||||
|
||||
//Dim stack As New Stack(Of DirectoryInfo)
|
||||
Stack<KeyValuePair<DirectoryInfo, DirectoryInfo>> stack = new Stack<KeyValuePair<DirectoryInfo, DirectoryInfo>>();
|
||||
|
||||
|
||||
this.filter = filter;
|
||||
KeyValuePair<DirectoryInfo, DirectoryInfo> pair = new KeyValuePair<DirectoryInfo, DirectoryInfo>();
|
||||
|
||||
|
||||
//stack.Push(root)
|
||||
stack.Push(new KeyValuePair<DirectoryInfo, DirectoryInfo>(root, destRoot));
|
||||
|
||||
while ((stack.Count > 0))
|
||||
{
|
||||
KeyValuePair<DirectoryInfo, DirectoryInfo> curDirKV = stack.Pop();
|
||||
//curDirKP = stack.Pop()
|
||||
DirectoryInfo dir = curDirKV.Key;
|
||||
DirectoryInfo dDir = curDirKV.Value;
|
||||
try
|
||||
{
|
||||
//result.AddRange(dir.GetFiles(filter, SearchOption.TopDirectoryOnly))
|
||||
// dividere file qui
|
||||
if (filesPerFolder > 0 & separateFiles)
|
||||
{
|
||||
appendDictionary(dirSourceDest, dividiFilesInDir(dir, dDir));
|
||||
}
|
||||
else
|
||||
{
|
||||
appendDictionary(dirSourceDest, getAllFilesInDir(dir, dDir));
|
||||
}
|
||||
|
||||
|
||||
|
||||
foreach (DirectoryInfo subDirectory in dir.GetDirectories())
|
||||
{
|
||||
stack.Push(new KeyValuePair<DirectoryInfo, DirectoryInfo>(subDirectory, new DirectoryInfo(Path.Combine(dDir.FullName, subDirectory.Name))));
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
return dirSourceDest;
|
||||
}
|
||||
|
||||
public Dictionary<FileInfo, DirectoryInfo> appendDictionary(Dictionary<FileInfo, DirectoryInfo> dictA, Dictionary<FileInfo, DirectoryInfo> dictB)
|
||||
{
|
||||
foreach (KeyValuePair<FileInfo, DirectoryInfo> pair in dictB)
|
||||
{
|
||||
dictA.Add(pair.Key, pair.Value);
|
||||
}
|
||||
return dictA;
|
||||
}
|
||||
|
||||
public Dictionary<FileInfo, DirectoryInfo> getAllFilesInDir(DirectoryInfo dir, DirectoryInfo dirDest)
|
||||
{
|
||||
Dictionary<FileInfo, DirectoryInfo> dict = new Dictionary<FileInfo, DirectoryInfo>();
|
||||
foreach (FileInfo File in dir.GetFiles(filter))
|
||||
{
|
||||
dict.Add(File, new DirectoryInfo(Path.Combine(dirDest.FullName, File.Name)));
|
||||
|
||||
}
|
||||
return dict;
|
||||
}
|
||||
|
||||
private Dictionary<FileInfo, DirectoryInfo> dividiFilesInDir(DirectoryInfo dir, DirectoryInfo dirDest)
|
||||
{
|
||||
int filesCount = dir.GetFiles(filter).Length;
|
||||
int contaFilePerDir = 0;
|
||||
int contaDirPerDir = 0;
|
||||
string tempText = string.Empty;
|
||||
Dictionary<FileInfo, DirectoryInfo> foldersDict = new Dictionary<FileInfo, DirectoryInfo>();
|
||||
|
||||
DirectoryInfo destDir = null;
|
||||
destDir = new DirectoryInfo(Path.Combine(dirDest.FullName));
|
||||
|
||||
foreach (FileInfo file in dir.GetFiles(filter))
|
||||
{
|
||||
contaFilePerDir += 1;
|
||||
|
||||
if (contaFilePerDir == (contaDirPerDir * filesPerFolder) + 1)
|
||||
{
|
||||
contaDirPerDir += 1;
|
||||
|
||||
if (numerazione.Progressiva.Equals(numerationType))
|
||||
{
|
||||
tempText = contaDirPerDir.ToString();
|
||||
}
|
||||
else
|
||||
{
|
||||
tempText = (contaDirPerDir * filesPerFolder).ToString();
|
||||
}
|
||||
int i = 0;
|
||||
for (i = 1; i <= (counterSize - tempText.Length); i++)
|
||||
{
|
||||
tempText = "0" + tempText;
|
||||
}
|
||||
destDir = new DirectoryInfo(Path.Combine(dirDest.FullName, suffix + tempText));
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
if (!destDir.Exists)
|
||||
{
|
||||
destDir.Create();
|
||||
}
|
||||
|
||||
foldersDict.Add(file, destDir);
|
||||
}
|
||||
|
||||
return foldersDict;
|
||||
}
|
||||
}
|
||||
110
ImageCatalogCS/ImageCatalog 3.csproj
Normal file
110
ImageCatalogCS/ImageCatalog 3.csproj
Normal file
|
|
@ -0,0 +1,110 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.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')" />
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProjectGuid>{D11ED7B0-93E8-4F38-A142-EED72D7EE8B5}</ProjectGuid>
|
||||
<OutputType>WinExe</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>ImageCatalogCS</RootNamespace>
|
||||
<AssemblyName>ImageCatalogCS</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<SccProjectName>SAK</SccProjectName>
|
||||
<SccLocalPath>SAK</SccLocalPath>
|
||||
<SccAuxPath>SAK</SccAuxPath>
|
||||
<SccProvider>SAK</SccProvider>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Management" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Deployment" />
|
||||
<Reference Include="System.Drawing" />
|
||||
<Reference Include="System.Windows.Forms" />
|
||||
<Reference Include="System.Xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="AboutForm.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="AboutForm.Designer.cs">
|
||||
<DependentUpon>AboutForm.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="CreaImmagineSeparateThread.cs" />
|
||||
<Compile Include="ExifReader.cs" />
|
||||
<Compile Include="FileHelper.cs" />
|
||||
<Compile Include="ImageCreator.cs" />
|
||||
<Compile Include="MainForm.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="MainForm.Designer.cs">
|
||||
<DependentUpon>MainForm.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="PicSettings.cs" />
|
||||
<Compile Include="Program.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="Temperature.cs" />
|
||||
<Compile Include="XMLSettings.cs" />
|
||||
<Compile Include="XYThreadPool.cs" />
|
||||
<EmbeddedResource Include="AboutForm.resx">
|
||||
<DependentUpon>AboutForm.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="MainForm.resx">
|
||||
<DependentUpon>MainForm.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Properties\Resources.resx">
|
||||
<Generator>ResXFileCodeGenerator</Generator>
|
||||
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
|
||||
<SubType>Designer</SubType>
|
||||
</EmbeddedResource>
|
||||
<Compile Include="Properties\Resources.Designer.cs">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DependentUpon>Resources.resx</DependentUpon>
|
||||
</Compile>
|
||||
<None Include="Properties\Settings.settings">
|
||||
<Generator>SettingsSingleFileGenerator</Generator>
|
||||
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
|
||||
</None>
|
||||
<Compile Include="Properties\Settings.Designer.cs">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DependentUpon>Settings.settings</DependentUpon>
|
||||
<DesignTimeSharedInput>True</DesignTimeSharedInput>
|
||||
</Compile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="App.config" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
<Target Name="BeforeBuild">
|
||||
</Target>
|
||||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
-->
|
||||
</Project>
|
||||
1057
ImageCatalogCS/ImageCreator.cs
Normal file
1057
ImageCatalogCS/ImageCreator.cs
Normal file
File diff suppressed because it is too large
Load diff
1794
ImageCatalogCS/MainForm.Designer.cs
generated
Normal file
1794
ImageCatalogCS/MainForm.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load diff
548
ImageCatalogCS/MainForm.cs
Normal file
548
ImageCatalogCS/MainForm.cs
Normal file
|
|
@ -0,0 +1,548 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
using System.IO;
|
||||
using System.Drawing.Text;
|
||||
using System.Threading;
|
||||
|
||||
public delegate void XyThreadAdd(string Info);
|
||||
|
||||
namespace ImageCatalogCS
|
||||
{
|
||||
public partial class MainForm : Form
|
||||
{
|
||||
private bool stopAttivo;
|
||||
private bool waterSelectColor = false;
|
||||
|
||||
//pool
|
||||
private XYThreadPool myPool = new XYThreadPool();
|
||||
|
||||
private int contaImmaginiThread;
|
||||
|
||||
private int maxThreads = 15;
|
||||
private int minThreads = 5;
|
||||
|
||||
public MainForm()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void setDefaults()
|
||||
{
|
||||
txtSorgente.Text = "";
|
||||
txtDestinazione.Text = "";
|
||||
TextBox3.Text = "tn_";
|
||||
TextBox4.Text = "";
|
||||
TextBox5.Text = "350";
|
||||
TextBox6.Text = "350";
|
||||
TextBox27.Text = "2240";
|
||||
TextBox28.Text = "2240";
|
||||
TextBox9.Text = "0";
|
||||
TextBox11.Text = "20";
|
||||
TextBox12.Text = "8";
|
||||
//TextBox13.Text = ""
|
||||
TextBox10.Text = "";
|
||||
TextBox14.Text = "430";
|
||||
TextBox15.Text = "430";
|
||||
TextBox16.Text = "290";
|
||||
txtFilePerCartella.Text = "99";
|
||||
TextBox19.Text = "100";
|
||||
txtSuffissoCartelle.Text = "";
|
||||
txtCifreContatore.Text = "2";
|
||||
TextBox25.Text = "50";
|
||||
TextBox26.Text = "";
|
||||
TextBox7.Text = Convert.ToString(15);
|
||||
TextBox8.Text = Convert.ToString(5);
|
||||
TextBox34.Text = "Yellow";
|
||||
TextBox30.Text = "20";
|
||||
TextBox31.Text = "6";
|
||||
TextBox32.Text = "85";
|
||||
TextBox33.Text = "30";
|
||||
|
||||
|
||||
ComboBox1.Items.Add("Alto");
|
||||
ComboBox1.Items.Add("Basso");
|
||||
ComboBox1.SelectedIndex = 1;
|
||||
|
||||
ComboBox2.Items.Add("Sinistra");
|
||||
ComboBox2.Items.Add("Centro");
|
||||
ComboBox2.Items.Add("Destra");
|
||||
ComboBox2.SelectedIndex = 1;
|
||||
|
||||
// Create a obejct of InstalledFontCollection
|
||||
InstalledFontCollection InstalledFonts = new InstalledFontCollection();
|
||||
// Gets the array of FontFamily objects associated with this FontCollection.
|
||||
FontFamily[] fontfamilies = InstalledFonts.Families;
|
||||
|
||||
// Populates font combobox with the font name
|
||||
|
||||
foreach (FontFamily fontFamily in fontfamilies)
|
||||
{
|
||||
ComboBox3.Items.Add(fontFamily.Name);
|
||||
}
|
||||
|
||||
ComboBox3.Text = ComboBox3.Items[0].ToString();
|
||||
|
||||
ComboBox4.Items.Add("Sinistra");
|
||||
ComboBox4.Items.Add("Centro");
|
||||
ComboBox4.Items.Add("Destra");
|
||||
ComboBox4.SelectedIndex = 2;
|
||||
|
||||
ComboBox5.Items.Add("Alto");
|
||||
ComboBox5.Items.Add("Centro");
|
||||
ComboBox5.Items.Add("Basso");
|
||||
ComboBox5.SelectedIndex = 2;
|
||||
}
|
||||
|
||||
private void Form1_Load(object sender, EventArgs e)
|
||||
{
|
||||
Application.EnableVisualStyles();
|
||||
setDefaults();
|
||||
}
|
||||
|
||||
private void btnCreaCatalogo_Click(object sender, EventArgs e)
|
||||
{
|
||||
DateTime timestart;
|
||||
DateTime timeStop;
|
||||
|
||||
timestart = DateTime.Now;
|
||||
|
||||
txtFileInfo.Text = string.Empty;
|
||||
lblFotoTotaliNum.Text = "0";
|
||||
Label18.Text = "0";
|
||||
Label43.Text = "-s";
|
||||
|
||||
maxThreads = Convert.ToInt32(TextBox7.Text);
|
||||
minThreads = Convert.ToInt32(TextBox18.Text);
|
||||
|
||||
//setPicSettings(txtSorgente.Text, txtDestinazione.Text);
|
||||
makeSettingsFromForm();
|
||||
ProgressBar1.Minimum = 0;
|
||||
ProgressBar1.Step = 1;
|
||||
ProgressBar1.Value = 0;
|
||||
|
||||
System.Threading.Thread t1 = new System.Threading.Thread(creaCatalogoThread);
|
||||
|
||||
|
||||
}
|
||||
|
||||
private void creaCatalogoThread()
|
||||
{
|
||||
System.DateTime timeStart = DateTime.Now;
|
||||
myPool.StopThreadPool();
|
||||
myPool.StartThreadPool(minThreads, maxThreads);
|
||||
contaImmaginiThread = 0;
|
||||
|
||||
//creaImmaginiWithThreadMod(txtSorgente.Text, txtDestinazione.Text)
|
||||
//creaimmaginiWithThreadDict(txtSorgente.Text, txtDestinazione.Text);
|
||||
ThreadPoolWorkItem ThAttivo = null;
|
||||
//int i = 0;
|
||||
|
||||
// fine
|
||||
|
||||
|
||||
}
|
||||
|
||||
private int getNumerazione()
|
||||
{
|
||||
int numerazione = 0;
|
||||
if (rdbNumProgressiva.Checked)
|
||||
{
|
||||
numerazione = (int)FileHelper.numerazione.Progressiva;
|
||||
}
|
||||
else
|
||||
{
|
||||
numerazione = (int)FileHelper.numerazione.Files;
|
||||
}
|
||||
return numerazione;
|
||||
}
|
||||
|
||||
private void creaimmaginiWithThreadDict(string SourcePath, string DestPath)
|
||||
{
|
||||
Dictionary<FileInfo, DirectoryInfo> dirSourceDest = new Dictionary<FileInfo, DirectoryInfo>();
|
||||
|
||||
if (chkAggiornaSottodirectory.Checked & chkCreaSottocartelle.Checked) {
|
||||
FileHelper helper = new FileHelper(Convert.ToInt32(txtFilePerCartella.Text), txtSuffissoCartelle.Text, Convert.ToInt32(txtCifreContatore.Text), getNumerazione());
|
||||
//getfilesrecursive
|
||||
dirSourceDest = helper.GetFilesRecursive(new DirectoryInfo(SourcePath), new DirectoryInfo(DestPath), "*.jpg");
|
||||
|
||||
} else if (chkAggiornaSottodirectory.Checked & !chkCreaSottocartelle.Checked) {
|
||||
|
||||
}
|
||||
//else if ()
|
||||
|
||||
//= getDirsDict(SourcePath, DestPath)
|
||||
|
||||
KeyValuePair<FileInfo, DirectoryInfo> pair = default(KeyValuePair<FileInfo, DirectoryInfo>);
|
||||
|
||||
foreach (KeyValuePair<FileInfo, DirectoryInfo> pair_loopVariable in dirSourceDest) {
|
||||
pair = pair_loopVariable;
|
||||
//setLabel10Text("File: " + pair.Key.Name);
|
||||
string b = (Convert.ToInt32(Label18.Text) + 1).ToString();
|
||||
|
||||
ImageCreator ClsCreaImmagine = new ImageCreator(pair.Key, pair.Value);
|
||||
contaImmaginiThread += 1;
|
||||
myPool.InsertWorkItem(pair.Key.Name, new XyThreadAdd(ClsCreaImmagine.CreaImmagineThread), new object[1] { pair.Key.Name }, true);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private Dictionary<string, object> makeSettingsFromForm()
|
||||
{
|
||||
Dictionary<string, object> settingsDict = new Dictionary<string, object>();
|
||||
settingsDict.Add("sourceDirRoot", new DirectoryInfo(txtSorgente.Text));
|
||||
settingsDict.Add("destDirRoot", new DirectoryInfo(txtDestinazione.Text));
|
||||
|
||||
settingsDict.Add("DirDividiDestinazione", chkCreaSottocartelle.Checked);
|
||||
settingsDict.Add("DirDividiNumFile", txtFilePerCartella.Text);
|
||||
settingsDict.Add("DirDividiSuffisso", txtSuffissoCartelle.Text);
|
||||
settingsDict.Add("DirDividiNumCifre", txtCifreContatore.Text);
|
||||
|
||||
settingsDict.Add("DirDividiTipoNumerazione", rdbNumProgressiva.Checked ? "Progressiva" : "Files");
|
||||
|
||||
// if (rdbNumProgressiva.Checked)
|
||||
// settingsDict.Add("DirDividiTipoNumerazione", "Progressiva");
|
||||
//else
|
||||
// settingsDict.Add("DirDividiTipoNumerazione", "Files");
|
||||
|
||||
// Checkbox
|
||||
settingsDict.Add("creaMiniature", CheckBox1.Checked);
|
||||
settingsDict.Add("aggiungiTesto", CheckBox2.Checked);
|
||||
settingsDict.Add("grassetto", CheckBox3.Checked);
|
||||
settingsDict.Add("logoAggiungi", CheckBox5.Checked);
|
||||
settingsDict.Add("usaOrarioTestoApplicare", CheckBox8.Checked);
|
||||
//settingsDict.Add("usaOrarioMiniatura", CheckBox12.Checked);
|
||||
settingsDict.Add("fotoGrandeDimOrigina", CheckBox15.Checked);
|
||||
|
||||
settingsDict.Add("dimStandard", Convert.ToInt32(TextBox11.Text));
|
||||
settingsDict.Add("dimStandardMiniatura", Convert.ToInt32(TextBox25.Text));
|
||||
|
||||
|
||||
|
||||
|
||||
settingsDict.Add("usaRotazioneAutomatica", chkRotazioneAutomatica.Checked);
|
||||
settingsDict.Add("usaForzaJpg", chkForzaJpg.Checked);
|
||||
|
||||
settingsDict.Add("testoNome", CheckBox17.Checked);
|
||||
settingsDict.Add("nomeData", CheckBox16.Checked);
|
||||
|
||||
settingsDict.Add("testoFirmaStart", TextBox4.Text);
|
||||
settingsDict.Add("testoFirmaStartV", TextBox29.Text);
|
||||
|
||||
settingsDict.Add("dataPartenza", DateTimePicker1.Value);
|
||||
settingsDict.Add("testoOrario", TextBox18.Text);
|
||||
|
||||
settingsDict.Add("altezzaSmall", Convert.ToInt32(TextBox6.Text));
|
||||
settingsDict.Add("larghezzaSmall", Convert.ToInt32(TextBox5.Text));
|
||||
|
||||
|
||||
settingsDict.Add("aggiungiScritteMiniature", RadioButton3.Checked);
|
||||
settingsDict.Add("aggTempoGaraMin", RadioButton5.Checked);
|
||||
settingsDict.Add("aggNumTempMin", RadioButton7.Checked);
|
||||
|
||||
settingsDict.Add("dimVert", Convert.ToUInt32(TextBox30.Text));
|
||||
settingsDict.Add("margVert", Convert.ToInt32(TextBox31.Text));
|
||||
|
||||
settingsDict.Add("suffisso", TextBox3.Text);
|
||||
settingsDict.Add("trasparenza", Convert.ToInt32(TextBox9.Text));
|
||||
settingsDict.Add("ilFont", ComboBox3.SelectedItem.ToString());
|
||||
|
||||
|
||||
settingsDict.Add("posizione", ComboBox1.SelectedItem.ToString());
|
||||
settingsDict.Add("allineamento", ComboBox2.SelectedItem.ToString());
|
||||
settingsDict.Add("margine", Convert.ToInt32(TextBox12.Text));
|
||||
|
||||
settingsDict.Add("logoAltezza", Convert.ToInt32(TextBox14.Text));
|
||||
settingsDict.Add("logoLarghezza", Convert.ToInt32(TextBox15.Text));
|
||||
|
||||
settingsDict.Add("fontColoreRGB", ColorTranslator.FromHtml(TextBox34.Text));
|
||||
|
||||
|
||||
settingsDict.Add("logoNomeFile", TextBox10.Text);
|
||||
settingsDict.Add("logoTrasparenza", TextBox19.Text);
|
||||
settingsDict.Add("logoMargine", TextBox16.Text);
|
||||
settingsDict.Add("logoPosizioneH", ComboBox4.Text);
|
||||
settingsDict.Add("logoPosizioneV", ComboBox5.Text);
|
||||
|
||||
|
||||
settingsDict.Add("altezzaBig", Convert.ToInt32(TextBox27.Text));
|
||||
settingsDict.Add("larghezzaBig", Convert.ToInt32(TextBox28.Text));
|
||||
settingsDict.Add("dimMin", Convert.ToInt32(TextBox25.Text));
|
||||
|
||||
settingsDict.Add("testoMin", RadioButton6.Checked);
|
||||
|
||||
settingsDict.Add("jpegQuality", Convert.ToInt32(TextBox32.Text));
|
||||
settingsDict.Add("jpegQualityMin", Convert.ToInt32(TextBox33.Text));
|
||||
|
||||
return settingsDict;
|
||||
}
|
||||
|
||||
private void setPicSettings(string SourcePath, string DestPath)
|
||||
{
|
||||
DirectoryInfo SourceDir = new DirectoryInfo(SourcePath);
|
||||
DirectoryInfo DestDirStart = new DirectoryInfo(DestPath);
|
||||
DirectoryInfo DestDir = null;
|
||||
|
||||
PicSettings.directorySorgente = txtSorgente.Text;
|
||||
PicSettings.directoryDestinazione = txtDestinazione.Text;
|
||||
|
||||
|
||||
PicSettings.dimStandard = Convert.ToInt32(TextBox11.Text);
|
||||
PicSettings.dimStandardMiniatura = Convert.ToInt32(TextBox25.Text);
|
||||
|
||||
//PicSettings.UsaOrarioMiniatura = CheckBox12.Checked;
|
||||
PicSettings.UsaOrarioTestoApplicare = CheckBox8.Checked;
|
||||
PicSettings.UsaTempoGaraTestoApplicare = CheckBox7.Checked;
|
||||
|
||||
PicSettings.UsaRotazioneAutomatica = chkRotazioneAutomatica.Checked;
|
||||
PicSettings.UsaForzaJpg = chkForzaJpg.Checked;
|
||||
|
||||
if (CheckBox17.Checked)
|
||||
{
|
||||
PicSettings.TestoNome = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
PicSettings.TestoNome = false;
|
||||
|
||||
}
|
||||
|
||||
if (CheckBox16.Checked)
|
||||
{
|
||||
PicSettings.NomeData = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
PicSettings.NomeData = false;
|
||||
}
|
||||
PicSettings.TestoFirmaStart = TextBox4.Text;
|
||||
PicSettings.TestoFirmaStartV = TextBox29.Text;
|
||||
|
||||
PicSettings.DataPartenza = DateTimePicker1.Value;
|
||||
PicSettings.TestoOrario = TextBox18.Text;
|
||||
|
||||
PicSettings.AltezzaSmall = Convert.ToInt32(TextBox6.Text);
|
||||
PicSettings.LarghezzaSmall = Convert.ToInt32(TextBox5.Text);
|
||||
|
||||
PicSettings.CreaMiniature = CheckBox1.Checked;
|
||||
PicSettings.AggiungiScritteMiniature = RadioButton3.Checked;
|
||||
PicSettings.AggTempoGaraMin = RadioButton5.Checked;
|
||||
PicSettings.AggNumTempMin = RadioButton7.Checked;
|
||||
|
||||
|
||||
PicSettings.dimVert = Convert.ToInt32(TextBox30.Text);
|
||||
PicSettings.margVert = Convert.ToInt32(TextBox31.Text);
|
||||
|
||||
//PicSettings.NomeFileChild = childFile.Name
|
||||
PicSettings.Suffisso = TextBox3.Text;
|
||||
//PicSettings.Codice = TextBox13.Text
|
||||
|
||||
PicSettings.Trasparenza = Convert.ToInt32(TextBox9.Text);
|
||||
PicSettings.IlFont = ComboBox3.SelectedItem.ToString();
|
||||
PicSettings.Grassetto = CheckBox3.Checked;
|
||||
|
||||
PicSettings.Posizione = ComboBox1.SelectedItem.ToString();
|
||||
PicSettings.Allineamento = ComboBox2.SelectedItem.ToString();
|
||||
PicSettings.Margine = Convert.ToInt32(TextBox12.Text);
|
||||
|
||||
PicSettings.LogoAltezza = Convert.ToInt32(TextBox14.Text);
|
||||
PicSettings.LogoLarghezza = Convert.ToInt32(TextBox15.Text);
|
||||
|
||||
PicSettings.fontColoreRGB = ColorTranslator.FromHtml(TextBox34.Text);
|
||||
|
||||
PicSettings.LogoAggiungi = CheckBox5.Checked;
|
||||
PicSettings.LogoNomeFile = TextBox10.Text;
|
||||
PicSettings.LogoTrasparenza = TextBox19.Text;
|
||||
PicSettings.LogoMargine = TextBox16.Text;
|
||||
PicSettings.LogoPosizioneH = ComboBox4.Text;
|
||||
PicSettings.LogoPosizioneV = ComboBox5.Text;
|
||||
|
||||
PicSettings.FotoGrandeDimOrigina = CheckBox15.Checked;
|
||||
PicSettings.AltezzaBig = Convert.ToInt32(TextBox27.Text);
|
||||
PicSettings.LarghezzaBig = Convert.ToInt32(TextBox28.Text);
|
||||
PicSettings.DimMin = Convert.ToInt32(TextBox25.Text);
|
||||
|
||||
PicSettings.TestoMin = RadioButton6.Checked;
|
||||
|
||||
PicSettings.jpegQuality = Convert.ToInt64(TextBox32.Text);
|
||||
PicSettings.jpegQualityMin = Convert.ToInt64(TextBox33.Text);
|
||||
|
||||
PicSettings.mainForm = this;
|
||||
|
||||
|
||||
}
|
||||
|
||||
private void makeSettingsFromFile()
|
||||
{
|
||||
OpenFileDialog openFileDialog = new OpenFileDialog();
|
||||
openFileDialog.Filter = "Setup (*.xml)|*.xml|All valid files (*.*)|*.*";
|
||||
openFileDialog.FilterIndex = 0;
|
||||
openFileDialog.RestoreDirectory = true;
|
||||
|
||||
Dictionary<string, object> settingsDict = new Dictionary<string, object>(StringComparer.OrdinalIgnoreCase);
|
||||
|
||||
if (DialogResult.OK == openFileDialog.ShowDialog())
|
||||
{
|
||||
XMLSettings xmlSettings = new XMLSettings(openFileDialog.FileName);
|
||||
settingsDict = xmlSettings.getParametriDict();
|
||||
|
||||
|
||||
settingsDict = bindSettings(settingsDict);
|
||||
setLogoMiniature();
|
||||
this.Text = string.Format("Image Catalog - {0}", openFileDialog.FileName);
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
private void setLogoMiniature()
|
||||
{
|
||||
if (File.Exists(TextBox10.Text))
|
||||
{
|
||||
|
||||
PictureBox1.Image = Image.FromFile(TextBox10.Text);
|
||||
if (PictureBox1.Image.Height >= PictureBox1.Image.Width)
|
||||
{
|
||||
PictureBox1.Height = 160;
|
||||
PictureBox1.Width = Convert.ToInt32(160 * PictureBox1.Image.Width / PictureBox1.Image.Height);
|
||||
}
|
||||
else
|
||||
{
|
||||
PictureBox1.Width = 224;
|
||||
PictureBox1.Height = Convert.ToInt32(224 * PictureBox1.Image.Height / PictureBox1.Image.Width);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private Dictionary<string, object> bindSettings(Dictionary<string, object> dict)
|
||||
{
|
||||
|
||||
txtSorgente.Text = dict["dirSorgente"].ToString();
|
||||
txtDestinazione.Text = dict["dirDestinazione"].ToString();
|
||||
chkAggiornaSottodirectory.Checked = Convert.ToBoolean(dict["DirSottoDirectory"]);
|
||||
|
||||
chkCreaSottocartelle.Checked = Convert.ToBoolean(dict["dirDividiDestinazione"]);
|
||||
txtFilePerCartella.Text = dict["dirDividiNumFile"].ToString();
|
||||
txtSuffissoCartelle.Text = dict["dirDividiSuffisso"].ToString();
|
||||
txtCifreContatore.Text = dict["dirDividiNumCifre"].ToString();
|
||||
|
||||
if (dict["dirDividiTipoNumerazione"].ToString().ToUpper() == "PROGRESSIVA")
|
||||
rdbNumProgressiva.Checked = true;
|
||||
else
|
||||
rdbNumFiles.Checked = true;
|
||||
|
||||
CheckBox1.Checked = Convert.ToBoolean(dict["miniatureCrea"]);
|
||||
TextBox3.Text = dict["miniatureSuffisso"].ToString();
|
||||
TextBox5.Text = dict["miniatureAltezza"].ToString();
|
||||
TextBox6.Text = dict["miniatureLarghezza"].ToString();
|
||||
RadioButton3.Checked = Convert.ToBoolean(dict["miniatureAddScritta"]);
|
||||
RadioButton4.Checked = Convert.ToBoolean(dict["miniatureAddOrario"]);
|
||||
|
||||
TextBox27.Text = dict["fotoAltezza"].ToString();
|
||||
TextBox28.Text = dict["fotoLarghezza"].ToString();
|
||||
|
||||
TextBox11.Text = dict["fontDimensione"].ToString();
|
||||
TextBox25.Text = dict["fontDimensioneMiniatura"].ToString();
|
||||
CheckBox3.Checked = Convert.ToBoolean(dict["fontBold"]);
|
||||
ComboBox3.Text = dict["fontNome"].ToString();
|
||||
|
||||
TextBox4.Text = dict["testoTesto"].ToString();
|
||||
TextBox9.Text = dict["testoTrasparente"].ToString();
|
||||
TextBox12.Text = dict["testoMargine"].ToString();
|
||||
ComboBox1.Text = dict["testoPosizione"].ToString();
|
||||
ComboBox2.Text = dict["testoAllineamento"].ToString();
|
||||
|
||||
TextBox10.Text = dict["marchioFile"].ToString();
|
||||
TextBox14.Text = dict["marchioAltezza"].ToString();
|
||||
TextBox15.Text = dict["marchioLarghezza"].ToString();
|
||||
TextBox16.Text = dict["marchioMargine"].ToString();
|
||||
ComboBox4.Text = dict["marchioAllOrizzontale"].ToString();
|
||||
ComboBox5.Text = dict["marchioAllVerticale"].ToString();
|
||||
TextBox19.Text = dict["marchioTrasparenza"].ToString();
|
||||
CheckBox5.Checked = Convert.ToBoolean(dict["MarchioAggiungi"]);
|
||||
|
||||
CheckBox7.Checked = Convert.ToBoolean(dict["tempoGara"]);
|
||||
CheckBox8.Checked = Convert.ToBoolean(dict["orario"]);
|
||||
TextBox18.Text = dict["etichettaOrario"].ToString();
|
||||
|
||||
chkForzaJpg.Checked = Convert.ToBoolean(dict["generaleForzaJpg"]);
|
||||
chkRotazioneAutomatica.Checked = Convert.ToBoolean(dict["generaleRotazioneAutomatica"]);
|
||||
|
||||
TextBox30.Text = dict["grandezzaVerticale"].ToString();
|
||||
TextBox31.Text = dict["margineVerticale"].ToString();
|
||||
CheckBox15.Checked = Convert.ToBoolean(dict["dimensioniOriginali"]);
|
||||
TextBox29.Text = dict["testoVerticale"].ToString();
|
||||
RadioButton6.Checked = Convert.ToBoolean(dict["nomeMiniatura"]);
|
||||
CheckBox16.Checked = Convert.ToBoolean(dict["dataFoto"]);
|
||||
CheckBox17.Checked = Convert.ToBoolean(dict["numeroFoto"]);
|
||||
|
||||
|
||||
RadioButton5.Checked = Convert.ToBoolean(dict["tempoSmall"]);
|
||||
RadioButton7.Checked = Convert.ToBoolean(dict["numTempoSmall"]);
|
||||
|
||||
TextBox32.Text = dict["compressioneJpeg"].ToString();
|
||||
TextBox33.Text = dict["compressioneJpegMiniatura"].ToString();
|
||||
|
||||
TextBox34.Text = dict["coloreTestoRGB"].ToString();
|
||||
|
||||
|
||||
|
||||
return dict;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
private void caricaImpostazioniToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
makeSettingsFromFile();
|
||||
}
|
||||
|
||||
private void btnStopCreazione_Click(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
private void informazioniToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
AboutForm about = new AboutForm();
|
||||
about.Show();
|
||||
}
|
||||
|
||||
private void CheckBox2_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (CheckBox2.Checked)
|
||||
panelTesto.Enabled = true;
|
||||
else
|
||||
panelTesto.Enabled = false;
|
||||
}
|
||||
|
||||
private void CheckBox1_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (CheckBox1.Checked)
|
||||
panelMiniature.Enabled = true;
|
||||
else
|
||||
panelMiniature.Enabled = false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
123
ImageCatalogCS/MainForm.resx
Normal file
123
ImageCatalogCS/MainForm.resx
Normal file
|
|
@ -0,0 +1,123 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<metadata name="menuStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>17, 17</value>
|
||||
</metadata>
|
||||
</root>
|
||||
92
ImageCatalogCS/PicSettings.cs
Normal file
92
ImageCatalogCS/PicSettings.cs
Normal file
|
|
@ -0,0 +1,92 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Drawing;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ImageCatalogCS
|
||||
{
|
||||
static class PicSettings
|
||||
{
|
||||
// Root
|
||||
public static string directorySorgente { get; set; }
|
||||
public static string directoryDestinazione { get; set; }
|
||||
|
||||
public static int dimVert { get; set; }
|
||||
public static int margVert { get; set; }
|
||||
|
||||
public static int dimStandard { get; set; }
|
||||
public static int dimStandardMiniatura { get; set; }
|
||||
|
||||
public static bool NomeData { get; set; }
|
||||
public static bool TestoNome { get; set; }
|
||||
public static bool UsaOrarioMiniatura { get; set; }
|
||||
public static bool UsaOrarioTestoApplicare { get; set; }
|
||||
public static bool UsaTempoGaraTestoApplicare { get; set; }
|
||||
public static string TestoFirmaStart { get; set; }
|
||||
public static string TestoFirmaStartV { get; set; }
|
||||
public static DateTime DataPartenza { get; set; }
|
||||
|
||||
public static string TestoOrario { get; set; }
|
||||
public static bool UsaRotazioneAutomatica { get; set; }
|
||||
|
||||
public static bool UsaForzaJpg { get; set; }
|
||||
public static int LarghezzaSmall { get; set; }
|
||||
|
||||
public static int AltezzaSmall { get; set; }
|
||||
public static bool CreaMiniature { get; set; }
|
||||
public static bool AggiungiScritteMiniature { get; set; }
|
||||
public static bool AggTempoGaraMin { get; set; }
|
||||
|
||||
public static bool AggNumTempMin { get; set; }
|
||||
public static string Suffisso { get; set; }
|
||||
|
||||
public static string Codice { get; set; }
|
||||
public static int Trasparenza { get; set; }
|
||||
public static string IlFont { get; set; }
|
||||
|
||||
public static bool Grassetto { get; set; }
|
||||
public static string Posizione { get; set; }
|
||||
public static string Allineamento { get; set; }
|
||||
|
||||
public static int Margine { get; set; }
|
||||
public static int LogoAltezza { get; set; }
|
||||
|
||||
public static int LogoLarghezza { get; set; }
|
||||
|
||||
public static Color fontColoreRGB { get; set; }
|
||||
public static bool LogoAggiungi { get; set; }
|
||||
public static string LogoNomeFile { get; set; }
|
||||
public static string LogoTrasparenza { get; set; }
|
||||
public static string LogoMargine { get; set; }
|
||||
public static string LogoPosizioneH { get; set; }
|
||||
|
||||
public static string LogoPosizioneV { get; set; }
|
||||
public static bool FotoGrandeDimOrigina { get; set; }
|
||||
public static int AltezzaBig { get; set; }
|
||||
public static int LarghezzaBig { get; set; }
|
||||
public static DirectoryInfo DestDir { get; set; }
|
||||
|
||||
public static int DimMin { get; set; }
|
||||
|
||||
public static bool TestoMin { get; set; }
|
||||
public static bool SecretDefault { get; set; }
|
||||
public static bool SecretBig { get; set; }
|
||||
|
||||
public static bool SecretSmall { get; set; }
|
||||
public static string SecretPathSmall { get; set; }
|
||||
|
||||
public static string SecretPathBig { get; set; }
|
||||
public static long jpegQuality { get; set; }
|
||||
|
||||
public static long jpegQualityMin { get; set; }
|
||||
public static bool FotoRuotaADestra { get; set; } // Default False
|
||||
|
||||
public static bool FotoRuotaASinistra { get; set; } // Default False
|
||||
|
||||
public static string TempMinText { get; set; } // Default ""
|
||||
public static MainForm mainForm { get; set; }
|
||||
}
|
||||
}
|
||||
22
ImageCatalogCS/Program.cs
Normal file
22
ImageCatalogCS/Program.cs
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace ImageCatalogCS
|
||||
{
|
||||
static class Program
|
||||
{
|
||||
/// <summary>
|
||||
/// The main entry point for the application.
|
||||
/// </summary>
|
||||
[STAThread]
|
||||
static void Main()
|
||||
{
|
||||
Application.EnableVisualStyles();
|
||||
Application.SetCompatibleTextRenderingDefault(false);
|
||||
Application.Run(new MainForm());
|
||||
}
|
||||
}
|
||||
}
|
||||
36
ImageCatalogCS/Properties/AssemblyInfo.cs
Normal file
36
ImageCatalogCS/Properties/AssemblyInfo.cs
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// General Information about an assembly is controlled through the following
|
||||
// set of attributes. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
[assembly: AssemblyTitle("ImageCatalogCS")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("ImageCatalogCS")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2012")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// Setting ComVisible to false makes the types in this assembly not visible
|
||||
// to COM components. If you need to access a type in this assembly from
|
||||
// COM, set the ComVisible attribute to true on that type.
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
// The following GUID is for the ID of the typelib if this project is exposed to COM
|
||||
[assembly: Guid("00b0a7a5-0de0-48e6-b0c9-ec214aa338dd")]
|
||||
|
||||
// Version information for an assembly consists of the following four values:
|
||||
//
|
||||
// Major Version
|
||||
// Minor Version
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
||||
71
ImageCatalogCS/Properties/Resources.Designer.cs
generated
Normal file
71
ImageCatalogCS/Properties/Resources.Designer.cs
generated
Normal file
|
|
@ -0,0 +1,71 @@
|
|||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version:4.0.30319.18010
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace ImageCatalogCS.Properties
|
||||
{
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// A strongly-typed resource class, for looking up localized strings, etc.
|
||||
/// </summary>
|
||||
// This class was auto-generated by the StronglyTypedResourceBuilder
|
||||
// class via a tool like ResGen or Visual Studio.
|
||||
// To add or remove a member, edit your .ResX file then rerun ResGen
|
||||
// with the /str option, or rebuild your VS project.
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||
internal class Resources
|
||||
{
|
||||
|
||||
private static global::System.Resources.ResourceManager resourceMan;
|
||||
|
||||
private static global::System.Globalization.CultureInfo resourceCulture;
|
||||
|
||||
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
|
||||
internal Resources()
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the cached ResourceManager instance used by this class.
|
||||
/// </summary>
|
||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
internal static global::System.Resources.ResourceManager ResourceManager
|
||||
{
|
||||
get
|
||||
{
|
||||
if ((resourceMan == null))
|
||||
{
|
||||
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("ImageCatalogCS.Properties.Resources", typeof(Resources).Assembly);
|
||||
resourceMan = temp;
|
||||
}
|
||||
return resourceMan;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Overrides the current thread's CurrentUICulture property for all
|
||||
/// resource lookups using this strongly typed resource class.
|
||||
/// </summary>
|
||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
internal static global::System.Globalization.CultureInfo Culture
|
||||
{
|
||||
get
|
||||
{
|
||||
return resourceCulture;
|
||||
}
|
||||
set
|
||||
{
|
||||
resourceCulture = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
117
ImageCatalogCS/Properties/Resources.resx
Normal file
117
ImageCatalogCS/Properties/Resources.resx
Normal file
|
|
@ -0,0 +1,117 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
||||
30
ImageCatalogCS/Properties/Settings.Designer.cs
generated
Normal file
30
ImageCatalogCS/Properties/Settings.Designer.cs
generated
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version:4.0.30319.18010
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace ImageCatalogCS.Properties
|
||||
{
|
||||
|
||||
|
||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")]
|
||||
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
|
||||
{
|
||||
|
||||
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
|
||||
|
||||
public static Settings Default
|
||||
{
|
||||
get
|
||||
{
|
||||
return defaultInstance;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
7
ImageCatalogCS/Properties/Settings.settings
Normal file
7
ImageCatalogCS/Properties/Settings.settings
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
<?xml version='1.0' encoding='utf-8'?>
|
||||
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)">
|
||||
<Profiles>
|
||||
<Profile Name="(Default)" />
|
||||
</Profiles>
|
||||
<Settings />
|
||||
</SettingsFile>
|
||||
32
ImageCatalogCS/Temperature.cs
Normal file
32
ImageCatalogCS/Temperature.cs
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Management;
|
||||
|
||||
|
||||
|
||||
namespace ImageCatalogCS
|
||||
{
|
||||
public class Temperature
|
||||
{
|
||||
public double CurrentValue { get; set; }
|
||||
public string InstanceName { get; set; }
|
||||
public static List<Temperature> Temperatures
|
||||
{
|
||||
get
|
||||
{
|
||||
List<Temperature> result = new List<Temperature>();
|
||||
ManagementObjectSearcher searcher = new ManagementObjectSearcher(@"root\WMI", "SELECT * FROM MSAcpi_ThermalZoneTemperature");
|
||||
foreach (ManagementObject obj in searcher.Get())
|
||||
{
|
||||
Double temp = Convert.ToDouble(obj["CurrentTemperature"].ToString());
|
||||
temp = (temp - 2732) / 10.0;
|
||||
result.Add(new Temperature { CurrentValue = temp, InstanceName = obj["InstanceName"].ToString() });
|
||||
}
|
||||
return result;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
208
ImageCatalogCS/XMLSettings.cs
Normal file
208
ImageCatalogCS/XMLSettings.cs
Normal file
|
|
@ -0,0 +1,208 @@
|
|||
using Microsoft.VisualBasic;
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
|
||||
public class XMLSettings
|
||||
{
|
||||
|
||||
|
||||
private DataSet _ElencoParametri;
|
||||
|
||||
private string _NomeFileSetup;
|
||||
public XMLSettings(string FileSetup)
|
||||
{
|
||||
_ElencoParametri = new DataSet();
|
||||
_NomeFileSetup = FileSetup;
|
||||
|
||||
if (!string.IsNullOrEmpty(FileSetup))
|
||||
{
|
||||
CaricaParametriSetup();
|
||||
}
|
||||
}
|
||||
|
||||
public XMLSettings()
|
||||
{
|
||||
_ElencoParametri = new DataSet();
|
||||
_NomeFileSetup = "";
|
||||
}
|
||||
|
||||
public void CaricaParametriSetup()
|
||||
{
|
||||
_ElencoParametri = LeggiXmlDataSet("Setup", _NomeFileSetup, "Nome");
|
||||
}
|
||||
|
||||
public void SalvaParametriSetup()
|
||||
{
|
||||
if (System.IO.File.Exists(_NomeFileSetup) == true)
|
||||
{
|
||||
File.Delete(_NomeFileSetup);
|
||||
}
|
||||
_ElencoParametri.WriteXml(_NomeFileSetup);
|
||||
}
|
||||
|
||||
public Dictionary<string, object> getParametriDict()
|
||||
{
|
||||
CaricaParametriSetup();
|
||||
Dictionary<string, object> dictParam = new Dictionary<string, object>(StringComparer.OrdinalIgnoreCase);
|
||||
|
||||
//DataRow[] LElenco = _ElencoParametri.Tables["Setup"].Select("Nome='" + NomeParametro + "'");
|
||||
//DataTable table = _ElencoParametri.Tables["Setup"];
|
||||
|
||||
foreach (DataRow row in _ElencoParametri.Tables["Setup"].Rows)
|
||||
{
|
||||
dictParam.Add(row["Nome"].ToString(), row["Valore"]);
|
||||
}
|
||||
|
||||
return dictParam;
|
||||
}
|
||||
|
||||
public string LeggiParametroString(string NomeParametro)
|
||||
{
|
||||
string Risposta = "";
|
||||
|
||||
try
|
||||
{
|
||||
DataRow[] LElenco = _ElencoParametri.Tables["Setup"].Select("Nome='" + NomeParametro + "'");
|
||||
|
||||
DataRow LaRiga = null;
|
||||
foreach (DataRow LaRiga_loopVariable in LElenco)
|
||||
{
|
||||
LaRiga = LaRiga_loopVariable;
|
||||
Risposta = LaRiga["Valore"].ToString();
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
Risposta = "";
|
||||
}
|
||||
|
||||
return Risposta;
|
||||
}
|
||||
|
||||
public bool LeggiParametroBoolean(string NomeParametro)
|
||||
{
|
||||
string Risposta = "";
|
||||
|
||||
try
|
||||
{
|
||||
DataRow[] LElenco = _ElencoParametri.Tables["Setup"].Select("Nome='" + NomeParametro + "'");
|
||||
|
||||
DataRow LaRiga = null;
|
||||
foreach (DataRow LaRiga_loopVariable in LElenco)
|
||||
{
|
||||
LaRiga = LaRiga_loopVariable;
|
||||
Risposta = LaRiga["Valore"].ToString();
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
Risposta = "";
|
||||
}
|
||||
|
||||
switch (Risposta.ToUpper())
|
||||
{
|
||||
case "TRUE":
|
||||
case "OK":
|
||||
case "SI":
|
||||
case "1":
|
||||
case "YES":
|
||||
case "VERO":
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public void AggiornaParametro(string NomeParametro, object ValoreParametro)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (_ElencoParametri.Tables["Setup"] == null)
|
||||
{
|
||||
DataTable TabellaTmp = new DataTable("Setup");
|
||||
DataRow RigaTmp = null;
|
||||
|
||||
DataColumn LaColonna = null;
|
||||
LaColonna = TabellaTmp.Columns.Add("Nome", System.Type.GetType("System.String"));
|
||||
LaColonna = TabellaTmp.Columns.Add("Valore", System.Type.GetType("System.String"));
|
||||
|
||||
//* Aggiunge alla tabella tutte le righe
|
||||
RigaTmp = TabellaTmp.NewRow();
|
||||
RigaTmp["Nome"] = NomeParametro;
|
||||
RigaTmp["Valore"] = ValoreParametro;
|
||||
TabellaTmp.Rows.Add(RigaTmp);
|
||||
|
||||
_ElencoParametri.Tables.Add(TabellaTmp);
|
||||
}
|
||||
else
|
||||
{
|
||||
DataRow[] LElenco = _ElencoParametri.Tables["Setup"].Select("Nome='" + NomeParametro + "'");
|
||||
|
||||
if (LElenco.Length == 0)
|
||||
{
|
||||
DataRow LaRiga = null;
|
||||
LaRiga = _ElencoParametri.Tables["Setup"].NewRow();
|
||||
LaRiga["Nome"] = NomeParametro;
|
||||
LaRiga["Valore"] = ValoreParametro;
|
||||
_ElencoParametri.Tables["Setup"].Rows.Add(LaRiga);
|
||||
}
|
||||
else
|
||||
{
|
||||
LElenco[0]["Valore"] = ValoreParametro;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
catch
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private DataTable LeggiXmlDataTable(string NomeTabella, string NomeFileXml, string NomeColonnaChiave = "")
|
||||
{
|
||||
//* Crea e Legge il dataset dal file xml
|
||||
System.Data.DataSet DataSetXml = new System.Data.DataSet();
|
||||
DataSetXml.ReadXml(NomeFileXml);
|
||||
|
||||
//* Aggiunge il campo chiave
|
||||
if (!string.IsNullOrEmpty(NomeColonnaChiave))
|
||||
{
|
||||
DataSetXml.Tables[NomeTabella].Constraints.Add(NomeColonnaChiave, DataSetXml.Tables[NomeTabella].Columns[NomeColonnaChiave], true);
|
||||
}
|
||||
|
||||
//* Restituisce la risposta
|
||||
return DataSetXml.Tables[NomeTabella];
|
||||
}
|
||||
|
||||
private static DataSet LeggiXmlDataSet(string NomeTabella, string NomeFileXml, string NomeColonnaChiave = "")
|
||||
{
|
||||
//* Crea e Legge il dataset dal file xml
|
||||
DataSet DataSetXml = new DataSet();
|
||||
DataSetXml.ReadXml(NomeFileXml);
|
||||
|
||||
//* Aggiunge il campo chiave
|
||||
if (!string.IsNullOrEmpty(NomeColonnaChiave))
|
||||
{
|
||||
DataSetXml.Tables[NomeTabella].Constraints.Add(NomeColonnaChiave, DataSetXml.Tables[NomeTabella].Columns[NomeColonnaChiave], true);
|
||||
}
|
||||
|
||||
//* Restituisce la risposta
|
||||
return DataSetXml;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
public string NomeFileSetup
|
||||
{
|
||||
get { return _NomeFileSetup; }
|
||||
set { _NomeFileSetup = value; }
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
251
ImageCatalogCS/XYThreadPool.cs
Normal file
251
ImageCatalogCS/XYThreadPool.cs
Normal file
|
|
@ -0,0 +1,251 @@
|
|||
using Microsoft.VisualBasic;
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Diagnostics;
|
||||
|
||||
using System.Threading;
|
||||
|
||||
public delegate void ThreadErrorHandlerDelegate(ThreadPoolWorkItem oWorkItem, Exception oError);
|
||||
|
||||
public class ThreadPoolWorkItem
|
||||
{
|
||||
public bool m_bStoreOutput = false;
|
||||
public string m_sName = "";
|
||||
public Delegate m_pMethod = null;
|
||||
public object[] m_pInput = null;
|
||||
public object m_oOutput = null;
|
||||
public Exception m_oException = null;
|
||||
public ThreadPoolWorkItem()
|
||||
{
|
||||
}
|
||||
public ThreadPoolWorkItem(string sName, Delegate pMethod, object[] pInput, bool bStoreOutput)
|
||||
{
|
||||
m_sName = sName;
|
||||
m_pMethod = pMethod;
|
||||
m_pInput = pInput;
|
||||
m_bStoreOutput = bStoreOutput;
|
||||
}
|
||||
}
|
||||
|
||||
public class XYThreadPool
|
||||
{
|
||||
private Hashtable m_htThreads = new Hashtable(256);
|
||||
private int m_nMinThreadCount = 5;
|
||||
private int m_nMaxThreadCount = 10;
|
||||
private int m_nShutdownPause = 200;
|
||||
private int m_nServerPause = 25;
|
||||
private bool m_bContinue = false;
|
||||
private static Exception m_oException = null;
|
||||
private Queue m_qInput = new Queue(1024);
|
||||
private Queue m_qOutput = new Queue(1024);
|
||||
private Delegate m_delegateThreadErrorHandler = new ThreadErrorHandlerDelegate(OnThreadError);
|
||||
private void ThreadProc()
|
||||
{
|
||||
while (m_bContinue)
|
||||
{
|
||||
object obj = null;
|
||||
Monitor.Enter(this);
|
||||
if (m_qInput.Count > 0)
|
||||
obj = m_qInput.Dequeue();
|
||||
Monitor.Exit(this);
|
||||
if (obj == null)
|
||||
{
|
||||
bool bQuit = false;
|
||||
Monitor.Enter(this);
|
||||
if (m_htThreads.Count > m_nMinThreadCount)
|
||||
{
|
||||
m_htThreads.Remove(Thread.CurrentThread.Name);
|
||||
bQuit = true;
|
||||
}
|
||||
Monitor.Exit(this);
|
||||
if (bQuit)
|
||||
return;
|
||||
Thread.Sleep(10 * m_nServerPause);
|
||||
}
|
||||
else
|
||||
{
|
||||
ThreadPoolWorkItem oWorkItem = (ThreadPoolWorkItem)obj;
|
||||
//oWorkItem.m_oOutput = oWorkItem.m_pMethod.DynamicInvoke(oWorkItem.m_pInput)
|
||||
try
|
||||
{
|
||||
oWorkItem.m_oOutput = oWorkItem.m_pMethod.DynamicInvoke(oWorkItem.m_pInput);
|
||||
}
|
||||
catch (Exception oBug)
|
||||
{
|
||||
if ((m_delegateThreadErrorHandler != null))
|
||||
{
|
||||
try
|
||||
{
|
||||
object[] pInput = {
|
||||
oWorkItem,
|
||||
oBug
|
||||
};
|
||||
m_delegateThreadErrorHandler.DynamicInvoke(pInput);
|
||||
}
|
||||
catch
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
if (oWorkItem.m_bStoreOutput)
|
||||
{
|
||||
Monitor.Enter(m_qOutput);
|
||||
m_qOutput.Enqueue(oWorkItem);
|
||||
Monitor.Exit(m_qOutput);
|
||||
}
|
||||
Thread.Sleep(m_nServerPause);
|
||||
}
|
||||
}
|
||||
}
|
||||
private static void OnThreadError(ThreadPoolWorkItem oWorkItem, Exception oError)
|
||||
{
|
||||
if (oWorkItem == null)
|
||||
{
|
||||
m_oException = oError;
|
||||
}
|
||||
else
|
||||
{
|
||||
oWorkItem.m_oException = oError;
|
||||
}
|
||||
}
|
||||
public void SetThreadErrorHandler(ThreadErrorHandlerDelegate pMethod)
|
||||
{
|
||||
Monitor.Enter(this);
|
||||
m_delegateThreadErrorHandler = pMethod;
|
||||
Monitor.Exit(this);
|
||||
}
|
||||
public void SetServerPause(int nMilliseconds)
|
||||
{
|
||||
Monitor.Enter(this);
|
||||
if (nMilliseconds > 9 & nMilliseconds < 101)
|
||||
m_nServerPause = nMilliseconds;
|
||||
Monitor.Exit(this);
|
||||
}
|
||||
public void SetShutdownPause(int nMilliseconds)
|
||||
{
|
||||
Monitor.Enter(this);
|
||||
m_nShutdownPause = nMilliseconds;
|
||||
Monitor.Exit(this);
|
||||
}
|
||||
public Exception GetException()
|
||||
{
|
||||
return m_oException;
|
||||
}
|
||||
public void InsertWorkItem(ThreadPoolWorkItem oWorkItem)
|
||||
{
|
||||
try
|
||||
{
|
||||
Monitor.Enter(this);
|
||||
m_qInput.Enqueue(oWorkItem);
|
||||
if (m_bContinue && m_qInput.Count > m_htThreads.Count && m_htThreads.Count < m_nMaxThreadCount)
|
||||
{
|
||||
Thread th = new Thread(ThreadProc);
|
||||
th.Name = Guid.NewGuid().ToString();
|
||||
m_htThreads.Add(th.Name, th);
|
||||
th.Start();
|
||||
}
|
||||
}
|
||||
catch (Exception oBug)
|
||||
{
|
||||
m_oException = oBug;
|
||||
}
|
||||
finally
|
||||
{
|
||||
Monitor.Exit(this);
|
||||
}
|
||||
}
|
||||
public void InsertWorkItem(string sName, Delegate pMethod, object[] pArgs, bool bStoreOutput)
|
||||
{
|
||||
InsertWorkItem(new ThreadPoolWorkItem(sName, pMethod, pArgs, bStoreOutput));
|
||||
}
|
||||
public ThreadPoolWorkItem ExtractWorkItem()
|
||||
{
|
||||
object oWorkItem = null;
|
||||
Monitor.Enter(m_qOutput);
|
||||
if (m_qOutput.Count > 0)
|
||||
oWorkItem = m_qOutput.Dequeue();
|
||||
Monitor.Exit(m_qOutput);
|
||||
if (oWorkItem == null)
|
||||
return null;
|
||||
return (ThreadPoolWorkItem)oWorkItem;
|
||||
}
|
||||
public bool StartThreadPool(int nMinThreadCount = 5, int nMaxThreadCount = 10)
|
||||
{
|
||||
try
|
||||
{
|
||||
Monitor.Enter(this);
|
||||
if (m_bContinue == false)
|
||||
{
|
||||
m_bContinue = true;
|
||||
if (nMinThreadCount > 0)
|
||||
{
|
||||
m_nMinThreadCount = nMinThreadCount;
|
||||
}
|
||||
if (nMaxThreadCount > m_nMinThreadCount)
|
||||
{
|
||||
m_nMaxThreadCount = nMaxThreadCount;
|
||||
}
|
||||
else
|
||||
{
|
||||
m_nMaxThreadCount = 2 * m_nMinThreadCount;
|
||||
}
|
||||
int i = 0;
|
||||
for (i = 1; i <= m_nMinThreadCount; i++)
|
||||
{
|
||||
Thread th = new Thread(ThreadProc);
|
||||
th.Name = Guid.NewGuid().ToString();
|
||||
m_htThreads.Add(th.Name, th);
|
||||
th.Start();
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
catch (Exception oBug)
|
||||
{
|
||||
m_bContinue = false;
|
||||
m_oException = oBug;
|
||||
return false;
|
||||
}
|
||||
finally
|
||||
{
|
||||
Monitor.Exit(this);
|
||||
}
|
||||
}
|
||||
public void StopThreadPool()
|
||||
{
|
||||
Monitor.Enter(this);
|
||||
m_bContinue = false;
|
||||
Thread.Sleep(Math.Max(200, m_nShutdownPause));
|
||||
if ((m_nShutdownPause > 0))
|
||||
{
|
||||
IDictionaryEnumerator dict = m_htThreads.GetEnumerator();
|
||||
while (dict.MoveNext())
|
||||
{
|
||||
Thread th = (Thread)dict.Value;
|
||||
if (th.IsAlive)
|
||||
{
|
||||
try
|
||||
{
|
||||
th.Abort();
|
||||
}
|
||||
catch
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
m_htThreads.Clear();
|
||||
m_qInput.Clear();
|
||||
// m_qOutput.Clear()
|
||||
Monitor.Exit(this);
|
||||
}
|
||||
public int GetThreadCount()
|
||||
{
|
||||
Monitor.Enter(this);
|
||||
int nCount = m_htThreads.Count;
|
||||
Monitor.Exit(this);
|
||||
return nCount;
|
||||
}
|
||||
}
|
||||
6
WPFCatalog/App.config
Normal file
6
WPFCatalog/App.config
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<configuration>
|
||||
<startup>
|
||||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
|
||||
</startup>
|
||||
</configuration>
|
||||
5
WPFCatalog/App.xaml
Normal file
5
WPFCatalog/App.xaml
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
<Application x:Class="WPFCatalog.App" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" StartupUri="MainWindow.xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" d1p1:Ignorable="d" xmlns:d1p1="http://schemas.openxmlformats.org/markup-compatibility/2006">
|
||||
<Application.Resources>
|
||||
<vm:ViewModelLocator x:Key="Locator" d:IsDataSource="True" xmlns:vm="clr-namespace:WPFCatalog.ViewModel" />
|
||||
</Application.Resources>
|
||||
</Application>
|
||||
17
WPFCatalog/App.xaml.cs
Normal file
17
WPFCatalog/App.xaml.cs
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Configuration;
|
||||
using System.Data;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
|
||||
namespace WPFCatalog
|
||||
{
|
||||
/// <summary>
|
||||
/// Interaction logic for App.xaml
|
||||
/// </summary>
|
||||
public partial class App : Application
|
||||
{
|
||||
}
|
||||
}
|
||||
BIN
WPFCatalog/Icons/camera-photo-5.png
Normal file
BIN
WPFCatalog/Icons/camera-photo-5.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.2 KiB |
BIN
WPFCatalog/Icons/document-open-6.png
Normal file
BIN
WPFCatalog/Icons/document-open-6.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1 KiB |
BIN
WPFCatalog/Icons/face-smile-2.png
Normal file
BIN
WPFCatalog/Icons/face-smile-2.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.2 KiB |
BIN
WPFCatalog/Icons/format-justify-left-2.png
Normal file
BIN
WPFCatalog/Icons/format-justify-left-2.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 3.4 KiB |
BIN
WPFCatalog/Icons/photo.png
Normal file
BIN
WPFCatalog/Icons/photo.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1 KiB |
BIN
WPFCatalog/Icons/picture.png
Normal file
BIN
WPFCatalog/Icons/picture.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1 KiB |
424
WPFCatalog/MainWindow.xaml
Normal file
424
WPFCatalog/MainWindow.xaml
Normal file
|
|
@ -0,0 +1,424 @@
|
|||
<Window x:Name="MainWindow1" x:Class="WPFCatalog.MainWindow"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:wpfCatalog="clr-namespace:WPFCatalog"
|
||||
mc:Ignorable="d"
|
||||
d:DataContext="{d:DesignInstance wpfCatalog:MainWindowViewModel}"
|
||||
|
||||
|
||||
Title="Image Catalog" Height="466" Width="772"
|
||||
|
||||
>
|
||||
<Window.Resources>
|
||||
<Style x:Key="CommonStyle" TargetType="FrameworkElement">
|
||||
<Setter Property="Margin" Value="4" />
|
||||
</Style>
|
||||
<Style TargetType="TextBox" BasedOn="{StaticResource CommonStyle}"></Style>
|
||||
<Style TargetType="Button" >
|
||||
<Setter Property="Margin" Value="2,2,5,5" />
|
||||
</Style>
|
||||
<Style TargetType="ComboBox" BasedOn="{StaticResource CommonStyle}"></Style>
|
||||
|
||||
</Window.Resources>
|
||||
<DockPanel LastChildFill="True">
|
||||
<Menu DockPanel.Dock="Top" Height="auto">
|
||||
<MenuItem Header="Files"/>
|
||||
<MenuItem Header="Modifica"></MenuItem>
|
||||
<MenuItem Header="?"></MenuItem>
|
||||
|
||||
|
||||
</Menu>
|
||||
<StatusBar DockPanel.Dock="Bottom" Height="auto">
|
||||
<StatusBarItem>
|
||||
<ProgressBar Width="510" Height="10">
|
||||
|
||||
</ProgressBar>
|
||||
</StatusBarItem>
|
||||
</StatusBar>
|
||||
<DockPanel >
|
||||
<!--<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition/>
|
||||
<ColumnDefinition/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition/>
|
||||
</Grid.RowDefinitions>-->
|
||||
<TabControl DockPanel.Dock="Left" Width="520">
|
||||
<TabItem>
|
||||
<TabItem.Header>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
|
||||
<TextBlock Text="Generale" Margin="0,0,5,0"/>
|
||||
<Image Source="Icons/camera-photo-5.png" Width="16" Height="16" />
|
||||
</StackPanel>
|
||||
</TabItem.Header>
|
||||
<WrapPanel>
|
||||
<GroupBox Header="Directory" >
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition />
|
||||
<RowDefinition />
|
||||
<RowDefinition />
|
||||
</Grid.RowDefinitions>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition />
|
||||
<ColumnDefinition Width="400"/>
|
||||
<ColumnDefinition Width="30"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
|
||||
<Label Grid.Row="0" Grid.Column="0" Content="Sorgente"/>
|
||||
<TextBox Grid.Row="0" Grid.Column="1" x:Name="txtSorgente" Margin="0,5" Text="{Binding DirSorgente}" />
|
||||
<Button Grid.Row="0" Grid.Column="2" x:Name="btnOpenSorgente" Margin="5,5" Command="{Binding OpenSorgenteCommand}">
|
||||
<Button.Content>
|
||||
<Image Source="Icons/document-open-6.png" />
|
||||
</Button.Content>
|
||||
</Button>
|
||||
|
||||
|
||||
<Label Grid.Row="1" Grid.Column="0" Content="Destinazione"/>
|
||||
<TextBox Grid.Row="1" Grid.Column="1" x:Name="txtDestinazione" Margin="0,5" Text="{Binding DirDestinazione}"/>
|
||||
<Button Grid.Row="1" Grid.Column="2" x:Name="btnOpenDestinazione" Margin="5,5" Command="{Binding OpenDestinazioneCommand}">
|
||||
<Button.Content>
|
||||
<Image Source="Icons/document-open-6.png" />
|
||||
</Button.Content>
|
||||
</Button>
|
||||
|
||||
<CheckBox Grid.Row="2" Grid.Column="1" Content="Aggiorna le sottodirectory" x:Name="chkAggiornaSottodirectory" IsChecked="{Binding DirAggiornaSottoDirectory}"/>
|
||||
|
||||
</Grid>
|
||||
|
||||
</GroupBox>
|
||||
<GroupBox Header="Generale" Margin="2">
|
||||
<StackPanel Orientation="Vertical" >
|
||||
<CheckBox Content="Aggiorna JPG" x:Name="chkForzaJPG" IsChecked="{Binding GeneraleForzaJpg}" Margin="2"/>
|
||||
<CheckBox Content="Rotazione Automatica" x:Name="chkRotazioneAutomatica" IsChecked="{Binding GeneraleRotazioneAutomatica}" Margin="2"/>
|
||||
<CheckBox Content="Sovrascrivi File" x:Name="chkSovrascriviFile" IsChecked="{Binding GeneraleSovrascriviFile}" Margin="2"/>
|
||||
</StackPanel>
|
||||
</GroupBox>
|
||||
<GroupBox Header="Sottocartelle" Margin="2">
|
||||
<StackPanel Orientation="Vertical">
|
||||
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition />
|
||||
<ColumnDefinition />
|
||||
<ColumnDefinition />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition />
|
||||
<RowDefinition />
|
||||
<RowDefinition />
|
||||
|
||||
</Grid.RowDefinitions>
|
||||
<CheckBox Grid.Row="0" Grid.Column="1" Content="Crea Sottocartelle" x:Name="chkCreaSottocartelle" Margin="4,0,0,0" IsChecked="{Binding SubdirCreaSottoCartelle}"/>
|
||||
<Label Grid.Row="1" Grid.Column="0" Content="Ogni"/>
|
||||
<StackPanel Orientation="Horizontal" Grid.Row="1" Grid.Column="1">
|
||||
<TextBox Width="50" HorizontalAlignment="Left" x:Name="txtOgni" Text="{Binding SubdirIntervalloFile}"/>
|
||||
<Label Content="file"/>
|
||||
</StackPanel>
|
||||
|
||||
<Label Grid.Row="2" Grid.Column="0" Content="Suffisso" />
|
||||
<TextBox Grid.Row="2" Grid.Column="1" HorizontalAlignment="Stretch" x:Name="txtSuffisso" Text="{Binding SubdirSuffisso}"/>
|
||||
</Grid>
|
||||
|
||||
<StackPanel Orientation="Horizontal" >
|
||||
<Label Content="Num. Cifre Contatore" />
|
||||
<TextBox Width="40" HorizontalAlignment="Right" x:Name="txtNumCifreContatore" Text="{Binding SubdirCifreContatore}"/>
|
||||
|
||||
</StackPanel>
|
||||
<RadioButton Content="Numerazione Progressiva" IsChecked="{Binding SubdirNumerazioneProgressiva}" x:Name="rdbNumerazioneProgressiva" />
|
||||
<RadioButton Content="Numerazione Files" x:Name="rdbNumerazioneFiles" IsChecked="{Binding SubdirNumerazioneFiles}"/>
|
||||
</StackPanel>
|
||||
</GroupBox>
|
||||
<GroupBox Margin="2">
|
||||
<GroupBox.Header>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<Image Source="Icons/photo.png" />
|
||||
<TextBlock Text="Foto" Margin="5,0,0,0" />
|
||||
</StackPanel>
|
||||
</GroupBox.Header>
|
||||
<Grid >
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition/>
|
||||
<RowDefinition/>
|
||||
<RowDefinition/>
|
||||
<RowDefinition/>
|
||||
<RowDefinition/>
|
||||
</Grid.RowDefinitions>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="15*"/>
|
||||
<ColumnDefinition Width="48*"/>
|
||||
<ColumnDefinition Width="88*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<Label Grid.Row="0" Grid.Column="0" Content="Altezza" Grid.ColumnSpan="2" Margin="0,0,0,2" />
|
||||
<TextBox Grid.Row="0" Grid.Column="2" Width="80" Margin="4,4,4,6" Text="{Binding FotoAltezza}"/>
|
||||
|
||||
|
||||
<Label Grid.Column="0" Content="Larghezza" Grid.ColumnSpan="2" Margin="0,26,0,2" Grid.RowSpan="2" />
|
||||
<TextBox Grid.Row="1" Grid.Column="2" Width="80" Margin="4,2,4,6" Text="{Binding FotoLarghezza}"></TextBox>
|
||||
|
||||
<Label Grid.Row="1" Grid.Column="0" Content="Qualità" Grid.ColumnSpan="2" Margin="0,24,0,1" Grid.RowSpan="2" />
|
||||
<TextBox Grid.Row="2" Grid.Column="2" Width="80" Margin="4,2,4,5" />
|
||||
|
||||
<CheckBox Grid.Row="3" Grid.Column="1" HorizontalAlignment="Right" VerticalAlignment="Center" Margin="0,16,0,17.88" IsChecked="{Binding FotoMantieniDimensioni}"/>
|
||||
<TextBlock Grid.Row="3" Grid.Column="2" Text="Mantieni Dimensioni Originali" TextWrapping="WrapWithOverflow" Width="80" Margin="4,0,4,25.88" Grid.RowSpan="2" />
|
||||
|
||||
<Label Grid.Row="4" Grid.Column="0" Content="Suffisso" Grid.ColumnSpan="2" Margin="0,0.12,0,-0.12" />
|
||||
<TextBox Grid.Row="4" Grid.Column="2" Width="80" Margin="4,4.12,4,3.88" Text="{Binding FotoSuffisso}" />
|
||||
</Grid>
|
||||
</GroupBox>
|
||||
</WrapPanel>
|
||||
</TabItem>
|
||||
<TabItem>
|
||||
<TabItem.Header>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
|
||||
<CheckBox VerticalAlignment="Center" IsChecked="{Binding TestoAttivo}"/>
|
||||
<Label Content="Testo" VerticalAlignment="Center"/>
|
||||
<Image Source="Icons/format-justify-left-2.png" />
|
||||
</StackPanel>
|
||||
</TabItem.Header>
|
||||
<StackPanel Orientation="Vertical">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<GroupBox Header="Carattere">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition/>
|
||||
<RowDefinition/>
|
||||
<RowDefinition/>
|
||||
<RowDefinition/>
|
||||
</Grid.RowDefinitions>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition/>
|
||||
<ColumnDefinition/>
|
||||
<ColumnDefinition/>
|
||||
<ColumnDefinition/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Label Grid.Row="0" Grid.Column="0" Content="Font"/>
|
||||
<ComboBox Grid.Row="0" Grid.Column="1" Grid.ColumnSpan="2" Width="100" HorizontalAlignment="Right" SelectedItem="{Binding CarattereFont}" /> <!--todo-->
|
||||
|
||||
<CheckBox Grid.Row="0" Grid.Column="3" Content="Grassetto" VerticalAlignment="Center" IsChecked="{Binding CarattereGrassetto}" />
|
||||
|
||||
<Label Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="2" Content="Dimensione"/>
|
||||
<TextBox Grid.Row="1" Grid.Column="2" Text="{Binding CarattereDimensione}"/>
|
||||
|
||||
<Label Grid.Row="2" Grid.Column="0" Grid.ColumnSpan="2" Content="Dimensione Miniatura"/>
|
||||
<TextBox Grid.Row="2" Grid.Column="2" Text="{Binding CarattereDimensioneMiniatura}"/>
|
||||
|
||||
<Label Grid.Row="3" Grid.Column="0" Grid.ColumnSpan="2" Content="Colore RGB" />
|
||||
|
||||
<TextBox Grid.Row="3" Grid.Column="2" Text="{Binding CarattereColoreRGB}"/>
|
||||
<Button Grid.Row="3" Grid.Column="3" Content="Scegli..." />
|
||||
|
||||
|
||||
</Grid>
|
||||
</GroupBox>
|
||||
<StackPanel Orientation="Vertical" VerticalAlignment="Stretch">
|
||||
<GroupBox Header="Slide Show" VerticalAlignment="Stretch">
|
||||
<StackPanel Orientation="Horizontal" >
|
||||
<CheckBox Content="Data" Margin="5,0" IsChecked="{Binding SlideshowData}"/>
|
||||
<CheckBox Content="Numero Foto" Margin="5,0" IsChecked="{Binding SlideshowNumeroFoto}"/>
|
||||
</StackPanel>
|
||||
</GroupBox>
|
||||
<GroupBox Header="Testo foto verticali" VerticalAlignment="Stretch">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition />
|
||||
<RowDefinition />
|
||||
</Grid.RowDefinitions>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition />
|
||||
<ColumnDefinition />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Label Grid.Row="0" Grid.Column="0" Content="Dimensione Carattere"/>
|
||||
<TextBox Grid.Row="0" Grid.Column="1" Width="40" Text="{Binding TestoVertDimensioneCarattere}"/>
|
||||
<Label Grid.Row="1" Grid.Column="0" Content="Margine"/>
|
||||
<TextBox Grid.Row="1" Grid.Column="1" Width="40" Text="{Binding TestoVertMargine}"/>
|
||||
</Grid>
|
||||
</GroupBox>
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
<GroupBox Header="Testo da applicare">
|
||||
<StackPanel Orientation="Vertical">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition />
|
||||
<RowDefinition />
|
||||
</Grid.RowDefinitions>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Label Grid.Row="0" Grid.Column="0" Content="Orizzontale" />
|
||||
<Label Grid.Row="1" Grid.Column="0" Content="Verticale" />
|
||||
<TextBox Grid.Row="0" Grid.Column="1" Text="{Binding TestoApplicareOrizzontale}"/>
|
||||
<TextBox Grid.Row="1" Grid.Column="1" Height="50" MaxLines="4" AcceptsReturn="True" Text="{Binding TestoApplicareVerticale}"/>
|
||||
</Grid>
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition />
|
||||
<RowDefinition />
|
||||
<RowDefinition />
|
||||
</Grid.RowDefinitions>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition />
|
||||
<ColumnDefinition />
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition />
|
||||
<ColumnDefinition />
|
||||
<ColumnDefinition />
|
||||
<ColumnDefinition />
|
||||
<ColumnDefinition />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Label Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2" Content="Trasparenza(0-100%)" />
|
||||
<TextBox Grid.Row="0" Grid.Column="2" Text="{Binding TestoApplicareTrasparenza}" />
|
||||
|
||||
<Label Grid.Row="1" Grid.Column="0" Content="Posizione" />
|
||||
<ComboBox Grid.Row="1" Grid.Column="1" Grid.ColumnSpan="2" /> <!--ToDo-->
|
||||
|
||||
<CheckBox Grid.Row="2" Grid.Column="1" Content="Orario" IsChecked="{Binding TestoApplicareOrario}"/>
|
||||
<CheckBox Grid.Row="2" Grid.Column="2" Content="Tempo Gara" IsChecked="{Binding TestoApplicareTempoGaraCheck}"/>
|
||||
|
||||
<TextBox Grid.Row="2" Grid.Column="3" Grid.ColumnSpan="2" Text="{Binding TestoApplicareTempoGara}"/>
|
||||
|
||||
<Label Grid.Row="0" Grid.Column="4" Grid.ColumnSpan="2" Content="Margine (pixel)" HorizontalAlignment="Right" />
|
||||
<TextBox Grid.Row="0" Grid.Column="6" Grid.ColumnSpan="2" Text="{Binding TestoApplicareMargine}"/>
|
||||
|
||||
<Label Grid.Row="1" Grid.Column="4" Grid.ColumnSpan="2" Content="Allineamento" HorizontalAlignment="Right" />
|
||||
<TextBox Grid.Row="1" Grid.Column="6" Grid.ColumnSpan="2" Text="{Binding TestoApplicareAllineamento}"/>
|
||||
|
||||
<Label Grid.Row="2" Grid.Column="5" Content="Partenza" />
|
||||
<ComboBox Grid.Row="2" Grid.Column="6" Grid.ColumnSpan="2" /> <!--todo-->
|
||||
</Grid>
|
||||
</StackPanel>
|
||||
</GroupBox>
|
||||
</StackPanel>
|
||||
</TabItem>
|
||||
<TabItem>
|
||||
<TabItem.Header>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
|
||||
<CheckBox VerticalAlignment="Center" />
|
||||
<Label VerticalAlignment="Center" Content="Miniature" />
|
||||
<Image Source="Icons/picture.png" />
|
||||
</StackPanel>
|
||||
</TabItem.Header>
|
||||
<WrapPanel>
|
||||
<GroupBox Header="Miniature">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition />
|
||||
<RowDefinition />
|
||||
<RowDefinition />
|
||||
<RowDefinition />
|
||||
</Grid.RowDefinitions>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition />
|
||||
<ColumnDefinition Width="100"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Label Grid.Row="0" Grid.Column="0" Content="Suffisso" />
|
||||
<TextBox Grid.Row="0" Grid.Column="1" Text="{Binding MiniatureSuffisso}"/>
|
||||
|
||||
<Label Grid.Row="1" Grid.Column="0" Content="Larghezza" />
|
||||
<TextBox Grid.Row="1" Grid.Column="1" Text="{Binding MiniatureLarghezza}"/>
|
||||
|
||||
<Label Grid.Row="2" Grid.Column="0" Content="Altezza" />
|
||||
<TextBox Grid.Row="2" Grid.Column="1" Text="{Binding MiniatureAltezza}"/>
|
||||
|
||||
<Label Grid.Row="3" Grid.Column="0" Content="Qualità" />
|
||||
<TextBox Grid.Row="3" Grid.Column="1" Text="{Binding MiniatureQualita}"/>
|
||||
</Grid>
|
||||
</GroupBox>
|
||||
<GroupBox Header="Testo Miniature" >
|
||||
<WrapPanel Orientation="Vertical" >
|
||||
<RadioButton Content="Aggiungi Scritta" Margin="4,2,4,2" IsChecked="{Binding TestoMinAggiungiScritta}" />
|
||||
<RadioButton Content="Aggiungi Orario" Margin="4,2,4,2" IsChecked="{Binding TestoMinAggiungiOrario}"/>
|
||||
<RadioButton Content="Tempo Gara" Margin="4,2,4,2" IsChecked="{Binding TestoMinTempoGara}"/>
|
||||
<RadioButton Content="Numero Foto" Margin="4,2,4,2" IsChecked="{Binding TestoMinNumeroFoto}"/>
|
||||
<RadioButton Content="Numero + Tempo" Margin="4,2,4,2" IsChecked="{Binding TestoMinNumeroTempo}"></RadioButton>
|
||||
</WrapPanel>
|
||||
</GroupBox>
|
||||
</WrapPanel>
|
||||
|
||||
</TabItem>
|
||||
<TabItem>
|
||||
<TabItem.Header>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
|
||||
<CheckBox VerticalAlignment="Center" />
|
||||
<Label VerticalAlignment="Center" Content="Logo" />
|
||||
<Image Source="Icons/face-smile-2.png"/>
|
||||
</StackPanel>
|
||||
</TabItem.Header>
|
||||
|
||||
<WrapPanel>
|
||||
<GroupBox Header="Logo">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition />
|
||||
<RowDefinition />
|
||||
<RowDefinition />
|
||||
<RowDefinition />
|
||||
<RowDefinition />
|
||||
<RowDefinition />
|
||||
<RowDefinition />
|
||||
<RowDefinition />
|
||||
</Grid.RowDefinitions>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="50" />
|
||||
<ColumnDefinition Width="50"/>
|
||||
<ColumnDefinition Width="200"/>
|
||||
<ColumnDefinition Width="30"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Label Grid.Row="0" Grid.Column="0" Content="Percorso Immagine"/>
|
||||
<TextBox Grid.Row="0" Grid.Column="1" Grid.ColumnSpan="3" Text="{Binding LogoPercorsoImmagine}"/>
|
||||
<Button Grid.Row="0" Grid.Column="4" Content="..." Command="{Binding ScegliLogoCommand}" />
|
||||
|
||||
<Label Grid.Row="1" Grid.Column="0" Content="Altezza" />
|
||||
<TextBox Grid.Row="1" Grid.Column="1" Grid.ColumnSpan="2" Text="{Binding LogoAltezza}" />
|
||||
|
||||
<Label Grid.Row="2" Grid.Column="0" Content="Larghezza" />
|
||||
<TextBox Grid.Row="2" Grid.Column="1" Grid.ColumnSpan="2" Text="{Binding LogoLarghezza}" />
|
||||
|
||||
<Label Grid.Row="3" Grid.Column="0" Content="Trasparenza (0-100%)" />
|
||||
<TextBox Grid.Row="3" Grid.Column="1" Grid.ColumnSpan="2" Text="{Binding LogoTrasparenza}" />
|
||||
|
||||
<Label Grid.Row="4" Grid.Column="0" Content="Margine (pixel %)" />
|
||||
<TextBox Grid.Row="4" Grid.Column="1" Grid.ColumnSpan="2" Text="{Binding LogoMargine}" />
|
||||
|
||||
<Label Grid.Row="5" Grid.Column="0" Content="Posizione Orizzontale" />
|
||||
<ComboBox Grid.Row="5" Grid.Column="1" Grid.ColumnSpan="2" /> <!--todo-->
|
||||
|
||||
<Label Grid.Row="6" Grid.Column="0" Content="Posizione Verticale" />
|
||||
<ComboBox Grid.Row="6" Grid.Column="1" Grid.ColumnSpan="2" /> <!--todo-->
|
||||
|
||||
<Label Grid.Row="7" Grid.Column="0" Content="Colore Trasparente" />
|
||||
<Image Grid.Row="7" Grid.Column="1" Width="24" Height="24" HorizontalAlignment="Left" />
|
||||
<Image Grid.Row="7" Grid.Column="8" Width="24" Height="24" HorizontalAlignment="Right" />
|
||||
|
||||
<Image Grid.Row="1" Grid.Column="3" Grid.RowSpan="7" />
|
||||
|
||||
</Grid>
|
||||
</GroupBox>
|
||||
</WrapPanel>
|
||||
|
||||
</TabItem>
|
||||
</TabControl>
|
||||
<StackPanel DockPanel.Dock="Right" Orientation="Vertical">
|
||||
<GroupBox DockPanel.Dock="Right" Header="Statistiche">
|
||||
<Button Content="STOP" Width="192" Command="{Binding StopCommand}"/>
|
||||
</GroupBox>
|
||||
</StackPanel>
|
||||
|
||||
</DockPanel>
|
||||
|
||||
</DockPanel>
|
||||
|
||||
|
||||
|
||||
</Window>
|
||||
40
WPFCatalog/MainWindow.xaml.cs
Normal file
40
WPFCatalog/MainWindow.xaml.cs
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Data;
|
||||
using System.Windows.Documents;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Media.Imaging;
|
||||
using System.Windows.Navigation;
|
||||
using System.Windows.Shapes;
|
||||
using CatalogLib;
|
||||
|
||||
namespace WPFCatalog
|
||||
{
|
||||
/// <summary>
|
||||
/// Interaction logic for MainWindow.xaml
|
||||
/// </summary>
|
||||
public partial class MainWindow : Window
|
||||
{
|
||||
public PicSettings GlobalSettings = new PicSettings();
|
||||
public MainWindow()
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
DataContext = new MainWindowViewModel();
|
||||
|
||||
SetDefaults();
|
||||
}
|
||||
|
||||
private void SetDefaults()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
493
WPFCatalog/MainWindowViewModel.cs
Normal file
493
WPFCatalog/MainWindowViewModel.cs
Normal file
|
|
@ -0,0 +1,493 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using CatalogLib;
|
||||
|
||||
namespace WPFCatalog
|
||||
{
|
||||
public class MainWindowViewModel : ViewModelBase
|
||||
{
|
||||
public PicSettings PicSettings { get; set; }
|
||||
|
||||
public MainWindowViewModel()
|
||||
{
|
||||
PicSettings = new PicSettings();
|
||||
|
||||
}
|
||||
|
||||
#region Proprietà
|
||||
|
||||
public PicSettings SettingsString
|
||||
{
|
||||
get { return PicSettings; }
|
||||
}
|
||||
|
||||
public string DirSorgente
|
||||
{
|
||||
get { return PicSettings.GetString("dirSorgente"); }
|
||||
set { PicSettings.Set("dirSorgente", value); }
|
||||
}
|
||||
|
||||
public string DirDestinazione
|
||||
{
|
||||
get { return PicSettings.GetString("dirDestinazione"); }
|
||||
set
|
||||
{
|
||||
PicSettings.Set("dirDestinazione", value);
|
||||
RaisePropertyChanged("DirDestinazione");
|
||||
}
|
||||
}
|
||||
|
||||
public bool DirSottoDirectory
|
||||
{
|
||||
get { return PicSettings.GetBool("dirSottoDirectory"); }
|
||||
set
|
||||
{
|
||||
PicSettings.Set("dirSottoDirectory", value);
|
||||
RaisePropertyChanged("DirSottoDirectory");
|
||||
}
|
||||
}
|
||||
|
||||
public bool SubdirCreaSottoCartelle
|
||||
{
|
||||
//get { return PicSettings.GetBool("")}
|
||||
}
|
||||
|
||||
public string DirDividiNumFile { get { return PicSettings.GetString("dirDividiNumFile"); } set { PicSettings.Set("dirDividiNumFile", value); } }
|
||||
public string DirDividiSuffisso { get { return PicSettings.GetString("dirDividiSuffisso"); } set { PicSettings.Set("dirDividiSuffisso", value); } }
|
||||
public string DirDividiNumCifre { get { return PicSettings.GetString("dirDividiNumCifre"); } set { PicSettings.Set("dirDividiNumCifre", value); RaisePropertyChanged("DirDividiNumCifre");} }
|
||||
public bool DirDividiDestinazione { get { return PicSettings.GetBool("dirDividiDestinazione"); } set { PicSettings.Set("dirDividiDestinazione", value); } }
|
||||
public bool DirDividiTipoNumerazioneProg { get { return PicSettings.GetString("DirDividiTipoNumerazione").ToUpper() == "PROGRESSIVA"; } set { if (value == true) PicSettings.Set("DirDividiTipoNumerazione", "PROGRESSIVA"); } }
|
||||
public bool DirDividiTipoNumerazioneFile { get { return PicSettings.GetString("DirDividiTipoNumerazione").ToUpper() == "FILES"; } set { if (value == false) PicSettings.Set("DirDividiTipoNumerazione", "FILES"); } }
|
||||
public bool MiniatureCrea { get { return PicSettings.GetBool("miniatureCrea"); } set { PicSettings.Set("miniatureCrea",value); RaisePropertyChanged("MiniatureCrea");} }
|
||||
|
||||
public string MiniatureSuffisso
|
||||
{
|
||||
get { return PicSettings.GetString("miniatureSuffisso"); }
|
||||
set
|
||||
{
|
||||
PicSettings.Set("miniatureSuffisso", value);
|
||||
RaisePropertyChanged("MiniatureSuffisso");
|
||||
}
|
||||
}
|
||||
|
||||
public string MiniatureAltezza
|
||||
{
|
||||
get { return PicSettings.GetString("miniatureAltezza"); }
|
||||
set
|
||||
{
|
||||
PicSettings.Set("miniatureAltezza", value);
|
||||
RaisePropertyChanged("MiniatureAltezza");
|
||||
}
|
||||
}
|
||||
|
||||
public string MiniatureLarghezza
|
||||
{
|
||||
get { return PicSettings.GetString("miniatureLarghezza"); }
|
||||
set
|
||||
{
|
||||
PicSettings.Set("miniatureLarghezza", value);
|
||||
RaisePropertyChanged("MiniatureLarghezza");
|
||||
}
|
||||
}
|
||||
|
||||
public bool MiniatureAddScritta
|
||||
{
|
||||
get { return PicSettings.GetBool("miniatureAddScritta"); }
|
||||
set
|
||||
{
|
||||
PicSettings.Set("miniatureAddScritta", value);
|
||||
RaisePropertyChanged("MiniatureAddScritta");
|
||||
}
|
||||
}
|
||||
|
||||
public bool MiniatureAddOrario
|
||||
{
|
||||
get { return PicSettings.GetBool("miniatureAddOrario"); }
|
||||
set
|
||||
{
|
||||
PicSettings.Set("miniatureAddOrario", value);
|
||||
RaisePropertyChanged("MiniatureAddOrario");
|
||||
}
|
||||
}
|
||||
|
||||
public string FotoAltezza
|
||||
{
|
||||
get { return PicSettings.GetString("fotoAltezza"); }
|
||||
set
|
||||
{
|
||||
PicSettings.Set("fotoAltezza", value);
|
||||
RaisePropertyChanged("FotoAltezza");
|
||||
}
|
||||
}
|
||||
|
||||
public string FotoLarghezza
|
||||
{
|
||||
get { return PicSettings.GetString("fotoLarghezza"); }
|
||||
set
|
||||
{
|
||||
PicSettings.Set("fotoLarghezza", value);
|
||||
RaisePropertyChanged("FotoLarghezza");
|
||||
}
|
||||
}
|
||||
|
||||
public string FontDimensione
|
||||
{
|
||||
get { return PicSettings.GetString("fontDimensione"); }
|
||||
set
|
||||
{
|
||||
PicSettings.Set("fontDimensione", value);
|
||||
RaisePropertyChanged("FontDimensione");
|
||||
}
|
||||
}
|
||||
|
||||
public string FontDimensioneMiniatura
|
||||
{
|
||||
get { return PicSettings.GetString("fontDimensioneMiniatura"); }
|
||||
set
|
||||
{
|
||||
PicSettings.Set("fontDimensioneMiniatura", value);
|
||||
RaisePropertyChanged("FontDimensioneMiniatura");
|
||||
}
|
||||
}
|
||||
|
||||
public bool FontBold
|
||||
{
|
||||
get { return PicSettings.GetBool("fontBold"); }
|
||||
set
|
||||
{
|
||||
PicSettings.Set("fontBold", value);
|
||||
RaisePropertyChanged("FontBold");
|
||||
}
|
||||
}
|
||||
|
||||
public bool FontNome
|
||||
{
|
||||
get { return PicSettings.GetBool("fontNome"); }
|
||||
set
|
||||
{
|
||||
PicSettings.Set("$parName", value);
|
||||
RaisePropertyChanged("FontNome");
|
||||
}
|
||||
}
|
||||
|
||||
public string TestoTesto
|
||||
{
|
||||
get { return PicSettings.GetString("testoTesto"); }
|
||||
set
|
||||
{
|
||||
PicSettings.Set("testoTesto", value);
|
||||
RaisePropertyChanged("TestoTesto");
|
||||
}
|
||||
}
|
||||
|
||||
public string TestoTrasparente
|
||||
{
|
||||
get { return PicSettings.GetString("testoTrasparente"); }
|
||||
set
|
||||
{
|
||||
PicSettings.Set("testoTrasparente", value);
|
||||
RaisePropertyChanged("TestoTrasparente");
|
||||
}
|
||||
}
|
||||
|
||||
public string TestoMargine
|
||||
{
|
||||
get { return PicSettings.GetString("testoMargine"); }
|
||||
set
|
||||
{
|
||||
PicSettings.Set("testoMargine", value);
|
||||
RaisePropertyChanged("TestoMargine");
|
||||
}
|
||||
}
|
||||
|
||||
public string TestoPosizione
|
||||
{
|
||||
get { return PicSettings.GetString("testoPosizione"); }
|
||||
set
|
||||
{
|
||||
PicSettings.Set("testoPosizione", value);
|
||||
RaisePropertyChanged("TestoPosizione");
|
||||
}
|
||||
}
|
||||
|
||||
public string TestoAllineamento
|
||||
{
|
||||
get { return PicSettings.GetString("testoAllineamento"); }
|
||||
set
|
||||
{
|
||||
PicSettings.Set("testoAllineamento", value);
|
||||
RaisePropertyChanged("TestoAllineamento");
|
||||
}
|
||||
}
|
||||
|
||||
public string MarchioFile
|
||||
{
|
||||
get { return PicSettings.GetString("marchioFile"); }
|
||||
set
|
||||
{
|
||||
PicSettings.Set("marchioFile", value);
|
||||
RaisePropertyChanged("MarchioFile");
|
||||
}
|
||||
}
|
||||
|
||||
public string MarchioAltezza
|
||||
{
|
||||
get { return PicSettings.GetString("marchioAltezza"); }
|
||||
set
|
||||
{
|
||||
PicSettings.Set("marchioAltezza", value);
|
||||
RaisePropertyChanged("MarchioAltezza");
|
||||
}
|
||||
}
|
||||
|
||||
public string MarchioLarghezza
|
||||
{
|
||||
get { return PicSettings.GetString("marchioLarghezza"); }
|
||||
set
|
||||
{
|
||||
PicSettings.Set("marchioLarghezza", value);
|
||||
RaisePropertyChanged("MarchioLarghezza");
|
||||
}
|
||||
}
|
||||
|
||||
public string MarchioMargine
|
||||
{
|
||||
get { return PicSettings.GetString("marchioMargine"); }
|
||||
set
|
||||
{
|
||||
PicSettings.Set("marchioMargine", value);
|
||||
RaisePropertyChanged("MarchioMargine");
|
||||
}
|
||||
}
|
||||
|
||||
public string MarchioAllOrizzontale
|
||||
{
|
||||
get { return PicSettings.GetString("marchioAllOrizzontale"); }
|
||||
set
|
||||
{
|
||||
PicSettings.Set("marchioAllOrizzontale", value);
|
||||
RaisePropertyChanged("MarchioAllOrizzontale");
|
||||
}
|
||||
}
|
||||
|
||||
public string MarchioAllVerticale
|
||||
{
|
||||
get { return PicSettings.GetString("marchioAllVerticale"); }
|
||||
set
|
||||
{
|
||||
PicSettings.Set("marchioAllVerticale", value);
|
||||
RaisePropertyChanged("MarchioAllVerticale");
|
||||
}
|
||||
}
|
||||
|
||||
public string MarchioTrasparenza
|
||||
{
|
||||
get { return PicSettings.GetString("marchioTrasparenza"); }
|
||||
set
|
||||
{
|
||||
PicSettings.Set("marchioTrasparenza", value);
|
||||
RaisePropertyChanged("MarchioTrasparenza");
|
||||
}
|
||||
}
|
||||
|
||||
public bool MarchioAggiungi
|
||||
{
|
||||
get { return PicSettings.GetBool("marchioAggiungi"); }
|
||||
set
|
||||
{
|
||||
PicSettings.Set("marchioAggiungi", value);
|
||||
RaisePropertyChanged("MarchioAggiungi");
|
||||
}
|
||||
}
|
||||
|
||||
public bool TempoGara
|
||||
{
|
||||
get { return PicSettings.GetBool("tempoGara"); }
|
||||
set
|
||||
{
|
||||
PicSettings.Set("tempoGara", value);
|
||||
RaisePropertyChanged("TempoGara");
|
||||
}
|
||||
}
|
||||
|
||||
public bool Orario
|
||||
{
|
||||
get { return PicSettings.GetBool("orario"); }
|
||||
set
|
||||
{
|
||||
PicSettings.Set("orario", value);
|
||||
RaisePropertyChanged("Orario");
|
||||
}
|
||||
}
|
||||
|
||||
public string EtichettaOrario
|
||||
{
|
||||
get { return PicSettings.GetString("etichettaOrario"); }
|
||||
set
|
||||
{
|
||||
PicSettings.Set("etichettaOrario", value);
|
||||
RaisePropertyChanged("EtichettaOrario");
|
||||
}
|
||||
}
|
||||
|
||||
public bool GeneraleForzaJpg
|
||||
{
|
||||
get { return PicSettings.GetBool("generaleForzaJpg"); }
|
||||
set
|
||||
{
|
||||
PicSettings.Set("generaleForzaJpg", value);
|
||||
RaisePropertyChanged("GeneraleForzaJpg");
|
||||
}
|
||||
}
|
||||
|
||||
public bool GeneraleRotazioneAutomatica
|
||||
{
|
||||
get { return PicSettings.GetBool("generaleRotazioneAutomatica"); }
|
||||
set
|
||||
{
|
||||
PicSettings.Set("generaleRotazioneAutomatica", value);
|
||||
RaisePropertyChanged("GeneraleRotazioneAutomatica");
|
||||
}
|
||||
}
|
||||
|
||||
public bool GeneraleSovrascriviFile
|
||||
{
|
||||
get { return PicSettings.GetBool("generaleSovrascriviFile"); }
|
||||
set
|
||||
{
|
||||
PicSettings.Set("generaleSovrascriviFile", value);
|
||||
RaisePropertyChanged("GeneraleSovrascriviFile");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public string GrandezzaVerticale
|
||||
{
|
||||
get { return PicSettings.GetString("grandezzaVerticale"); }
|
||||
set
|
||||
{
|
||||
PicSettings.Set("grandezzaVerticale", value);
|
||||
RaisePropertyChanged("GrandezzaVerticale");
|
||||
}
|
||||
}
|
||||
|
||||
public string MargineVerticale
|
||||
{
|
||||
get { return PicSettings.GetString("margineVerticale"); }
|
||||
set
|
||||
{
|
||||
PicSettings.Set("margineVerticale", value);
|
||||
RaisePropertyChanged("MargineVerticale");
|
||||
}
|
||||
}
|
||||
|
||||
public bool DimensioniOriginali
|
||||
{
|
||||
get { return PicSettings.GetBool("dimensioniOriginali"); }
|
||||
set
|
||||
{
|
||||
PicSettings.Set("dimensioniOriginali", value);
|
||||
RaisePropertyChanged("DimensioniOriginali");
|
||||
}
|
||||
}
|
||||
|
||||
public string TestoVerticale
|
||||
{
|
||||
get { return PicSettings.GetString("testoVerticale"); }
|
||||
set
|
||||
{
|
||||
PicSettings.Set("testoVerticale", value);
|
||||
RaisePropertyChanged("TestoVerticale");
|
||||
}
|
||||
}
|
||||
|
||||
public bool NomeMiniatura
|
||||
{
|
||||
get { return PicSettings.GetBool("nomeMiniatura"); }
|
||||
set
|
||||
{
|
||||
PicSettings.Set("nomeMiniatura", value);
|
||||
RaisePropertyChanged("NomeMiniatura");
|
||||
}
|
||||
}
|
||||
|
||||
public bool DataFoto
|
||||
{
|
||||
get { return PicSettings.GetBool("dataFoto"); }
|
||||
set
|
||||
{
|
||||
PicSettings.Set("dataFoto", value);
|
||||
RaisePropertyChanged("DataFoto");
|
||||
}
|
||||
}
|
||||
|
||||
public bool NumeroFoto
|
||||
{
|
||||
get { return PicSettings.GetBool("numeroFoto"); }
|
||||
set
|
||||
{
|
||||
PicSettings.Set("numeroFoto", value);
|
||||
RaisePropertyChanged("NumeroFoto");
|
||||
}
|
||||
}
|
||||
|
||||
public bool TempoSmall
|
||||
{
|
||||
get { return PicSettings.GetBool("tempoSmall"); }
|
||||
set
|
||||
{
|
||||
PicSettings.Set("tempoSmall", value);
|
||||
RaisePropertyChanged("TempoSmall");
|
||||
}
|
||||
}
|
||||
|
||||
public bool NumTempoSmall
|
||||
{
|
||||
get { return PicSettings.GetBool("numTempoSmall"); }
|
||||
set
|
||||
{
|
||||
PicSettings.Set("numTempoSmall", value);
|
||||
RaisePropertyChanged("NumTempoSmall");
|
||||
}
|
||||
}
|
||||
|
||||
public string CompressioneJpeg
|
||||
{
|
||||
get { return PicSettings.GetString("compressioneJpeg"); }
|
||||
set
|
||||
{
|
||||
PicSettings.Set("compressioneJpeg", value);
|
||||
RaisePropertyChanged("CompressioneJpeg");
|
||||
}
|
||||
}
|
||||
|
||||
public string CompressioneJpegMiniatura
|
||||
{
|
||||
get { return PicSettings.GetString("compressioneJpegMiniatura"); }
|
||||
set
|
||||
{
|
||||
PicSettings.Set("compressioneJpegMiniatura", value);
|
||||
RaisePropertyChanged("CompressioneJpegMiniatura");
|
||||
}
|
||||
}
|
||||
|
||||
public string ColoreTestoRGB
|
||||
{
|
||||
get { return PicSettings.GetString("coloreTestoRGB"); }
|
||||
set
|
||||
{
|
||||
PicSettings.Set("coloreTestoRGB", value);
|
||||
RaisePropertyChanged("ColoreTestoRGB");
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
55
WPFCatalog/Properties/AssemblyInfo.cs
Normal file
55
WPFCatalog/Properties/AssemblyInfo.cs
Normal file
|
|
@ -0,0 +1,55 @@
|
|||
using System.Reflection;
|
||||
using System.Resources;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Windows;
|
||||
|
||||
// General Information about an assembly is controlled through the following
|
||||
// set of attributes. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
[assembly: AssemblyTitle("WPFCatalog")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("WPFCatalog")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2013")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// Setting ComVisible to false makes the types in this assembly not visible
|
||||
// to COM components. If you need to access a type in this assembly from
|
||||
// COM, set the ComVisible attribute to true on that type.
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
//In order to begin building localizable applications, set
|
||||
//<UICulture>CultureYouAreCodingWith</UICulture> in your .csproj file
|
||||
//inside a <PropertyGroup>. For example, if you are using US english
|
||||
//in your source files, set the <UICulture> to en-US. Then uncomment
|
||||
//the NeutralResourceLanguage attribute below. Update the "en-US" in
|
||||
//the line below to match the UICulture setting in the project file.
|
||||
|
||||
//[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)]
|
||||
|
||||
|
||||
[assembly: ThemeInfo(
|
||||
ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
|
||||
//(used if a resource is not found in the page,
|
||||
// or application resource dictionaries)
|
||||
ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
|
||||
//(used if a resource is not found in the page,
|
||||
// app, or any theme specific resource dictionaries)
|
||||
)]
|
||||
|
||||
|
||||
// Version information for an assembly consists of the following four values:
|
||||
//
|
||||
// Major Version
|
||||
// Minor Version
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
||||
71
WPFCatalog/Properties/Resources.Designer.cs
generated
Normal file
71
WPFCatalog/Properties/Resources.Designer.cs
generated
Normal file
|
|
@ -0,0 +1,71 @@
|
|||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version:4.0.30319.18052
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace WPFCatalog.Properties
|
||||
{
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// A strongly-typed resource class, for looking up localized strings, etc.
|
||||
/// </summary>
|
||||
// This class was auto-generated by the StronglyTypedResourceBuilder
|
||||
// class via a tool like ResGen or Visual Studio.
|
||||
// To add or remove a member, edit your .ResX file then rerun ResGen
|
||||
// with the /str option, or rebuild your VS project.
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||
internal class Resources
|
||||
{
|
||||
|
||||
private static global::System.Resources.ResourceManager resourceMan;
|
||||
|
||||
private static global::System.Globalization.CultureInfo resourceCulture;
|
||||
|
||||
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
|
||||
internal Resources()
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the cached ResourceManager instance used by this class.
|
||||
/// </summary>
|
||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
internal static global::System.Resources.ResourceManager ResourceManager
|
||||
{
|
||||
get
|
||||
{
|
||||
if ((resourceMan == null))
|
||||
{
|
||||
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("WPFCatalog.Properties.Resources", typeof(Resources).Assembly);
|
||||
resourceMan = temp;
|
||||
}
|
||||
return resourceMan;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Overrides the current thread's CurrentUICulture property for all
|
||||
/// resource lookups using this strongly typed resource class.
|
||||
/// </summary>
|
||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
internal static global::System.Globalization.CultureInfo Culture
|
||||
{
|
||||
get
|
||||
{
|
||||
return resourceCulture;
|
||||
}
|
||||
set
|
||||
{
|
||||
resourceCulture = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
117
WPFCatalog/Properties/Resources.resx
Normal file
117
WPFCatalog/Properties/Resources.resx
Normal file
|
|
@ -0,0 +1,117 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
||||
30
WPFCatalog/Properties/Settings.Designer.cs
generated
Normal file
30
WPFCatalog/Properties/Settings.Designer.cs
generated
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version:4.0.30319.18052
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace WPFCatalog.Properties
|
||||
{
|
||||
|
||||
|
||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")]
|
||||
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
|
||||
{
|
||||
|
||||
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
|
||||
|
||||
public static Settings Default
|
||||
{
|
||||
get
|
||||
{
|
||||
return defaultInstance;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
7
WPFCatalog/Properties/Settings.settings
Normal file
7
WPFCatalog/Properties/Settings.settings
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
<?xml version='1.0' encoding='utf-8'?>
|
||||
<SettingsFile xmlns="uri:settings" CurrentProfile="(Default)">
|
||||
<Profiles>
|
||||
<Profile Name="(Default)" />
|
||||
</Profiles>
|
||||
<Settings />
|
||||
</SettingsFile>
|
||||
37
WPFCatalog/ViewModel/MainViewModel.cs
Normal file
37
WPFCatalog/ViewModel/MainViewModel.cs
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
using GalaSoft.MvvmLight;
|
||||
|
||||
namespace WPFCatalog.ViewModel
|
||||
{
|
||||
/// <summary>
|
||||
/// This class contains properties that the main View can data bind to.
|
||||
/// <para>
|
||||
/// Use the <strong>mvvminpc</strong> snippet to add bindable properties to this ViewModel.
|
||||
/// </para>
|
||||
/// <para>
|
||||
/// You can also use Blend to data bind with the tool's support.
|
||||
/// </para>
|
||||
/// <para>
|
||||
/// See http://www.galasoft.ch/mvvm
|
||||
/// </para>
|
||||
/// </summary>
|
||||
public class MainViewModel : ViewModelBase
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the MainViewModel class.
|
||||
/// </summary>
|
||||
public MainViewModel()
|
||||
{
|
||||
////if (IsInDesignMode)
|
||||
////{
|
||||
//// // Code runs in Blend --> create design time data.
|
||||
////}
|
||||
////else
|
||||
////{
|
||||
//// // Code runs "for real"
|
||||
////}
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
63
WPFCatalog/ViewModel/ViewModelLocator.cs
Normal file
63
WPFCatalog/ViewModel/ViewModelLocator.cs
Normal file
|
|
@ -0,0 +1,63 @@
|
|||
/*
|
||||
In App.xaml:
|
||||
<Application.Resources>
|
||||
<vm:ViewModelLocator xmlns:vm="clr-namespace:WPFCatalog"
|
||||
x:Key="Locator" />
|
||||
</Application.Resources>
|
||||
|
||||
In the View:
|
||||
DataContext="{Binding Source={StaticResource Locator}, Path=ViewModelName}"
|
||||
|
||||
You can also use Blend to do all this with the tool's support.
|
||||
See http://www.galasoft.ch/mvvm
|
||||
*/
|
||||
|
||||
using GalaSoft.MvvmLight;
|
||||
using GalaSoft.MvvmLight.Ioc;
|
||||
using Microsoft.Practices.ServiceLocation;
|
||||
|
||||
namespace WPFCatalog.ViewModel
|
||||
{
|
||||
/// <summary>
|
||||
/// This class contains static references to all the view models in the
|
||||
/// application and provides an entry point for the bindings.
|
||||
/// </summary>
|
||||
public class ViewModelLocator
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the ViewModelLocator class.
|
||||
/// </summary>
|
||||
public ViewModelLocator()
|
||||
{
|
||||
ServiceLocator.SetLocatorProvider(() => SimpleIoc.Default);
|
||||
|
||||
////if (ViewModelBase.IsInDesignModeStatic)
|
||||
////{
|
||||
//// // Create design time view services and models
|
||||
//// SimpleIoc.Default.Register<IDataService, DesignDataService>();
|
||||
////}
|
||||
////else
|
||||
////{
|
||||
//// // Create run time view services and models
|
||||
//// SimpleIoc.Default.Register<IDataService, DataService>();
|
||||
////}
|
||||
|
||||
SimpleIoc.Default.Register<MainViewModel>();
|
||||
}
|
||||
|
||||
public MainViewModel Main
|
||||
{
|
||||
get
|
||||
{
|
||||
return ServiceLocator.Current.GetInstance<MainViewModel>();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
public static void Cleanup()
|
||||
{
|
||||
// TODO Clear the ViewModels
|
||||
}
|
||||
}
|
||||
}
|
||||
127
WPFCatalog/ViewModelBase.cs
Normal file
127
WPFCatalog/ViewModelBase.cs
Normal file
|
|
@ -0,0 +1,127 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.ComponentModel;
|
||||
using System.Diagnostics;
|
||||
|
||||
namespace WPFCatalog
|
||||
{
|
||||
public abstract class ViewModelBase : GalaSoft.MvvmLight.ViewModelBase, INotifyPropertyChanged, IDisposable
|
||||
{
|
||||
|
||||
#region Constructor
|
||||
|
||||
protected ViewModelBase()
|
||||
{
|
||||
}
|
||||
|
||||
#endregion // Constructor
|
||||
|
||||
#region DisplayName
|
||||
|
||||
/// <summary>
|
||||
/// Returns the user-friendly name of this object.
|
||||
/// Child classes can set this property to a new value,
|
||||
/// or override it to determine the value on-demand.
|
||||
/// </summary>
|
||||
public virtual string DisplayName { get; protected set; }
|
||||
|
||||
#endregion // DisplayName
|
||||
|
||||
#region Debugging Aides
|
||||
|
||||
///// <summary>
|
||||
///// Warns the developer if this object does not have
|
||||
///// a public property with the specified name. This
|
||||
///// method does not exist in a Release build.
|
||||
///// </summary>
|
||||
//[Conditional("DEBUG")]
|
||||
//[DebuggerStepThrough]
|
||||
//public void VerifyPropertyName(string propertyName)
|
||||
//{
|
||||
// // Verify that the property name matches a real,
|
||||
// // public, instance property on this object.
|
||||
// if (TypeDescriptor.GetProperties(this)[propertyName] == null)
|
||||
// {
|
||||
// string msg = "Invalid property name: " + propertyName;
|
||||
|
||||
// if (this.ThrowOnInvalidPropertyName)
|
||||
// throw new Exception(msg);
|
||||
// else
|
||||
// Debug.Fail(msg);
|
||||
// }
|
||||
//}
|
||||
|
||||
/// <summary>
|
||||
/// Returns whether an exception is thrown, or if a Debug.Fail() is used
|
||||
/// when an invalid property name is passed to the VerifyPropertyName method.
|
||||
/// The default value is false, but subclasses used by unit tests might
|
||||
/// override this property's getter to return true.
|
||||
/// </summary>
|
||||
protected virtual bool ThrowOnInvalidPropertyName { get; private set; }
|
||||
|
||||
#endregion // Debugging Aides
|
||||
|
||||
|
||||
|
||||
#region INotifyPropertyChanged Members
|
||||
|
||||
/// <summary>
|
||||
/// Raised when a property on this object has a new value.
|
||||
/// </summary>
|
||||
//public event PropertyChangedEventHandler PropertyChanged;
|
||||
|
||||
///// <summary>
|
||||
///// Raises this object's PropertyChanged event.
|
||||
///// </summary>
|
||||
///// <param name="propertyName">The property that has a new value.</param>
|
||||
//protected virtual void OnPropertyChanged(string propertyName)
|
||||
//{
|
||||
// this.VerifyPropertyName(propertyName);
|
||||
|
||||
// PropertyChangedEventHandler handler = this.PropertyChanged;
|
||||
// if (handler != null)
|
||||
// {
|
||||
// var e = new PropertyChangedEventArgs(propertyName);
|
||||
// handler(this, e);
|
||||
// }
|
||||
//}
|
||||
|
||||
#endregion // INotifyPropertyChanged Members
|
||||
|
||||
#region IDisposable Members
|
||||
|
||||
/// <summary>
|
||||
/// Invoked when this object is being removed from the application
|
||||
/// and will be subject to garbage collection.
|
||||
/// </summary>
|
||||
public void Dispose()
|
||||
{
|
||||
this.OnDispose();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Child classes can override this method to perform
|
||||
/// clean-up logic, such as removing event handlers.
|
||||
/// </summary>
|
||||
protected virtual void OnDispose()
|
||||
{
|
||||
}
|
||||
|
||||
#if DEBUG
|
||||
/// <summary>
|
||||
/// Useful for ensuring that ViewModel objects are properly garbage collected.
|
||||
/// </summary>
|
||||
~ViewModelBase()
|
||||
{
|
||||
string msg = string.Format("{0} ({1}) ({2}) Finalized", this.GetType().Name, this.DisplayName, this.GetHashCode());
|
||||
System.Diagnostics.Debug.WriteLine(msg);
|
||||
}
|
||||
#endif
|
||||
|
||||
#endregion // IDisposable Members
|
||||
|
||||
}
|
||||
}
|
||||
178
WPFCatalog/WPFCatalog.csproj
Normal file
178
WPFCatalog/WPFCatalog.csproj
Normal file
|
|
@ -0,0 +1,178 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.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')" />
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProjectGuid>{638DE501-CECA-4744-B293-7AE93CAEEB01}</ProjectGuid>
|
||||
<OutputType>WinExe</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>WPFCatalog</RootNamespace>
|
||||
<AssemblyName>WPFCatalog</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<SccProjectName>SAK</SccProjectName>
|
||||
<SccLocalPath>SAK</SccLocalPath>
|
||||
<SccAuxPath>SAK</SccAuxPath>
|
||||
<SccProvider>SAK</SccProvider>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="Accessibility" />
|
||||
<Reference Include="GalaSoft.MvvmLight.Extras.WPF45">
|
||||
<HintPath>..\packages\MvvmLightLibs.4.1.27.1\lib\net45\GalaSoft.MvvmLight.Extras.WPF45.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="GalaSoft.MvvmLight.WPF45">
|
||||
<HintPath>..\packages\MvvmLightLibs.4.1.27.1\lib\net45\GalaSoft.MvvmLight.WPF45.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Practices.ServiceLocation">
|
||||
<HintPath>..\packages\CommonServiceLocator.1.0\lib\NET35\Microsoft.Practices.ServiceLocation.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="PresentationUI, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" />
|
||||
<Reference Include="ReachFramework" />
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.ComponentModel.DataAnnotations" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Data.Services.Client" />
|
||||
<Reference Include="System.Deployment" />
|
||||
<Reference Include="System.Drawing" />
|
||||
<Reference Include="System.Printing" />
|
||||
<Reference Include="System.Windows.Forms" />
|
||||
<Reference Include="System.Windows.Interactivity, Version=4.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\MvvmLightLibs.4.1.27.1\lib\net45\System.Windows.Interactivity.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Xml" />
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
<Reference Include="System.Xaml">
|
||||
<RequiredTargetFramework>4.0</RequiredTargetFramework>
|
||||
</Reference>
|
||||
<Reference Include="UIAutomationProvider" />
|
||||
<Reference Include="UIAutomationTypes" />
|
||||
<Reference Include="WindowsBase" />
|
||||
<Reference Include="PresentationCore" />
|
||||
<Reference Include="PresentationFramework" />
|
||||
<Reference Include="Xceed.Wpf.AvalonDock">
|
||||
<HintPath>..\packages\Extended.Wpf.Toolkit.2.1.0\lib\net40\Xceed.Wpf.AvalonDock.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Xceed.Wpf.AvalonDock.Themes.Aero">
|
||||
<HintPath>..\packages\Extended.Wpf.Toolkit.2.1.0\lib\net40\Xceed.Wpf.AvalonDock.Themes.Aero.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Xceed.Wpf.AvalonDock.Themes.Metro">
|
||||
<HintPath>..\packages\Extended.Wpf.Toolkit.2.1.0\lib\net40\Xceed.Wpf.AvalonDock.Themes.Metro.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Xceed.Wpf.AvalonDock.Themes.VS2010">
|
||||
<HintPath>..\packages\Extended.Wpf.Toolkit.2.1.0\lib\net40\Xceed.Wpf.AvalonDock.Themes.VS2010.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Xceed.Wpf.DataGrid">
|
||||
<HintPath>..\packages\Extended.Wpf.Toolkit.2.1.0\lib\net40\Xceed.Wpf.DataGrid.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Xceed.Wpf.Toolkit">
|
||||
<HintPath>..\packages\Extended.Wpf.Toolkit.2.1.0\lib\net40\Xceed.Wpf.Toolkit.dll</HintPath>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ApplicationDefinition Include="App.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</ApplicationDefinition>
|
||||
<Compile Include="ViewModelBase.cs" />
|
||||
<Compile Include="ViewModel\MainViewModel.cs" />
|
||||
<Compile Include="ViewModel\ViewModelLocator.cs" />
|
||||
<Page Include="MainWindow.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Compile Include="App.xaml.cs">
|
||||
<DependentUpon>App.xaml</DependentUpon>
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="MainWindow.xaml.cs">
|
||||
<DependentUpon>MainWindow.xaml</DependentUpon>
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="MainWindowViewModel.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Properties\Resources.Designer.cs">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DesignTime>True</DesignTime>
|
||||
<DependentUpon>Resources.resx</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Properties\Settings.Designer.cs">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DependentUpon>Settings.settings</DependentUpon>
|
||||
<DesignTimeSharedInput>True</DesignTimeSharedInput>
|
||||
</Compile>
|
||||
<EmbeddedResource Include="Properties\Resources.resx">
|
||||
<Generator>ResXFileCodeGenerator</Generator>
|
||||
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
|
||||
</EmbeddedResource>
|
||||
<None Include="packages.config" />
|
||||
<None Include="Properties\Settings.settings">
|
||||
<Generator>SettingsSingleFileGenerator</Generator>
|
||||
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
|
||||
</None>
|
||||
<AppDesigner Include="Properties\" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="App.config" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Resource Include="Icons\photo.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Resource Include="Icons\document-open-6.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Resource Include="Icons\camera-photo-5.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Resource Include="Icons\format-justify-left-2.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Resource Include="Icons\picture.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Resource Include="Icons\face-smile-2.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\CatalogLib\CatalogLib.csproj">
|
||||
<Project>{d27accf2-80fc-4de8-aeb8-351ff076e6d5}</Project>
|
||||
<Name>CatalogLib</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
<Target Name="BeforeBuild">
|
||||
</Target>
|
||||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
-->
|
||||
</Project>
|
||||
7
WPFCatalog/packages.config
Normal file
7
WPFCatalog/packages.config
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="CommonServiceLocator" version="1.0" targetFramework="net45" />
|
||||
<package id="Extended.Wpf.Toolkit" version="2.1.0" targetFramework="net45" />
|
||||
<package id="MvvmLight" version="4.1.27.1" targetFramework="net45" />
|
||||
<package id="MvvmLightLibs" version="4.1.27.1" targetFramework="net45" />
|
||||
</packages>
|
||||
31
imagecatalog/AssemblyInfo.vb
Normal file
31
imagecatalog/AssemblyInfo.vb
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
Imports System.Reflection
|
||||
Imports System.Runtime.InteropServices
|
||||
|
||||
' General Information about an assembly is controlled through the following
|
||||
' set of attributes. Change these attribute values to modify the information
|
||||
' associated with an assembly.
|
||||
|
||||
' Review the values of the assembly attributes
|
||||
|
||||
<Assembly: AssemblyTitle("Image Catalog")>
|
||||
<Assembly: AssemblyDescription("")>
|
||||
<Assembly: AssemblyCompany("FornaSoft")>
|
||||
<Assembly: AssemblyProduct("")>
|
||||
<Assembly: AssemblyCopyright("(C) 2002-08")>
|
||||
<Assembly: AssemblyTrademark("")>
|
||||
<Assembly: CLSCompliant(True)>
|
||||
|
||||
'The following GUID is for the ID of the typelib if this project is exposed to COM
|
||||
<Assembly: Guid("948AA2AA-5BED-4DD5-9C67-3126EE9109C6")>
|
||||
|
||||
' Version information for an assembly consists of the following four values:
|
||||
'
|
||||
' Major Version
|
||||
' Minor Version
|
||||
' Build Number
|
||||
' Revision
|
||||
'
|
||||
' You can specify all the values or you can default the Build and Revision Numbers
|
||||
' by using the '*' as shown below:
|
||||
|
||||
<Assembly: AssemblyVersion("1.74.*")>
|
||||
1
imagecatalog/ClassDiagram1.cd
Normal file
1
imagecatalog/ClassDiagram1.cd
Normal file
|
|
@ -0,0 +1 @@
|
|||
|
||||
943
imagecatalog/CreaImmagineSeparateMultiCore.vb
Normal file
943
imagecatalog/CreaImmagineSeparateMultiCore.vb
Normal file
|
|
@ -0,0 +1,943 @@
|
|||
Imports System.IO
|
||||
'Imports System.Drawing.Drawing2D
|
||||
'Imports System.Drawing.Imaging
|
||||
'Imports System.Threading
|
||||
|
||||
Public Class CreaImmagineSeparateMultiCore
|
||||
|
||||
Private _DirectorySorgente As String
|
||||
Private _DirectoryDestinazione As String
|
||||
|
||||
|
||||
Private _SourceDir As DirectoryInfo
|
||||
Private _DestDirStart As DirectoryInfo
|
||||
Private _DimStandard As Integer
|
||||
Private _DimStandardMiniatura As Integer
|
||||
|
||||
|
||||
Private _UsaOrarioMiniatura As Boolean
|
||||
Private _UsaOrarioTestoApplicare As Boolean
|
||||
Private _UsaTempoGaraTestoApplicare As Boolean
|
||||
Private _TestoFirmaStart As String
|
||||
Private _TestoFirmaStartV As String
|
||||
Private _DataPartenza As DateTime
|
||||
Private _TestoOrario As String
|
||||
|
||||
Private _UsaRotazioneAutomatica As Boolean
|
||||
Private _UsaForzaJpg As Boolean
|
||||
|
||||
Private _LarghezzaSmall As Integer
|
||||
Private _AltezzaSmall As Integer
|
||||
|
||||
Private _CreaMiniature As Boolean
|
||||
Private _AggiungiScritteMiniature As Boolean
|
||||
|
||||
Private _NomeFileChild As String
|
||||
Private _Suffisso As String
|
||||
Private _Codice As String
|
||||
|
||||
Private _Trasparenza As Integer
|
||||
Private _IlFont As String
|
||||
Private _Grassetto As Boolean
|
||||
|
||||
Private _Posizione As String
|
||||
Private _Allineamento As String
|
||||
Private _Margine As Integer
|
||||
|
||||
Private _LogoAltezza As Integer
|
||||
Private _LogoLarghezza As Integer
|
||||
|
||||
Private _FontColoreR As Integer
|
||||
Private _FontColoreG As Integer
|
||||
Private _FontColoreB As Integer
|
||||
|
||||
Private _LogoAggiungi As Boolean
|
||||
Private _LogoNomeFile As String
|
||||
Private _LogoTrasparenza As String
|
||||
Private _LogoMargine As String
|
||||
Private _LogoPosizioneH As String
|
||||
Private _LogoPosizioneV As String
|
||||
|
||||
Private _FotoGrandeDimOrigina As Boolean
|
||||
Private _AltezzaBig As Integer
|
||||
Private _LarghezzaBig As Integer
|
||||
Private _DestDir As DirectoryInfo
|
||||
|
||||
Public Sub CreaImmagine(ByVal InfoImg As PicInfo)
|
||||
Dim TestoFirma As String = ""
|
||||
|
||||
_DestDir = InfoImg.DirDest
|
||||
_SourceDir = InfoImg.DirSource
|
||||
_DestDirStart = InfoImg.DirDestStart
|
||||
_NomeFileChild = InfoImg.NomeImmagine
|
||||
|
||||
Dim AlphaScelta As Integer = CType((255 * (100 - _Trasparenza) / 100), Integer)
|
||||
|
||||
Dim DimensioneStandard As Integer
|
||||
Dim DimensioneStandardMiniatura As Integer
|
||||
|
||||
Dim DataFoto As DateTime
|
||||
Dim DataPartenzaI As DateTime = _DataPartenza
|
||||
If _TestoOrario.Length > 0 Then
|
||||
_TestoOrario &= " "
|
||||
End If
|
||||
Dim TestoFirmaPiccola As String = ""
|
||||
|
||||
Dim FileConta As Integer = 0
|
||||
Dim ContaFileXDir As Integer = 0
|
||||
Dim ContaDirXDir As Integer = 0
|
||||
Dim TestoTemp As String = ""
|
||||
Dim ContaTemp As Integer = 0
|
||||
|
||||
DimensioneStandard = _DimStandard
|
||||
DimensioneStandardMiniatura = _DimStandardMiniatura
|
||||
|
||||
Dim g As System.Drawing.Image = System.Drawing.Image.FromFile(Path.Combine(_SourceDir.FullName, _NomeFileChild))
|
||||
|
||||
If _UsaOrarioTestoApplicare = True Or _UsaTempoGaraTestoApplicare = True Or _UsaOrarioMiniatura = True Then
|
||||
If g.PropertyIdList.Length > 0 Then ' ci sono dati exif
|
||||
Dim DatiExif As New ExifReader(CType(g, Bitmap))
|
||||
DataFoto = DatiExif.DateTimeOriginal
|
||||
TestoFirma = _TestoFirmaStart
|
||||
If DataFoto.Year <> 1 Then
|
||||
TestoFirmaPiccola = DataFoto.ToShortTimeString
|
||||
If _UsaOrarioTestoApplicare = True Then
|
||||
TestoFirma &= " - " & DataFoto.ToShortDateString & " " & DataFoto.ToLongTimeString
|
||||
End If
|
||||
If _UsaTempoGaraTestoApplicare = True Then
|
||||
Dim Orario As TimeSpan = New TimeSpan(DateDiff(DateInterval.Second, DataPartenzaI, DataFoto) * 10000000)
|
||||
TestoFirma &= " - " & _TestoOrario & Orario.Hours.ToString("00") & ":" & Orario.Minutes.ToString("00") & ":" & Orario.Seconds.ToString("00")
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
Else
|
||||
TestoFirma = _TestoFirmaStart
|
||||
End If
|
||||
|
||||
Dim FotoRuotaADestra As Boolean = False
|
||||
Dim FotoRuotaASinistra As Boolean = False
|
||||
|
||||
If _UsaRotazioneAutomatica = True Then
|
||||
If g.PropertyIdList.Length > 0 Then ' ci sono dati exif
|
||||
Dim DatiExif As New ExifReader(CType(g, Bitmap))
|
||||
|
||||
Select Case DatiExif.Orientation
|
||||
Case ExifReader.Orientations.BottomLeft
|
||||
|
||||
Case ExifReader.Orientations.BottomRight
|
||||
|
||||
Case ExifReader.Orientations.LeftTop
|
||||
|
||||
Case ExifReader.Orientations.LftBottom
|
||||
FotoRuotaASinistra = True
|
||||
Case ExifReader.Orientations.RightBottom
|
||||
|
||||
Case ExifReader.Orientations.RightTop
|
||||
|
||||
Case ExifReader.Orientations.TopLeft
|
||||
|
||||
Case ExifReader.Orientations.TopRight
|
||||
|
||||
End Select
|
||||
End If
|
||||
End If
|
||||
'rotazione
|
||||
If FotoRuotaASinistra = True Then
|
||||
g.RotateFlip(RotateFlipType.Rotate270FlipNone)
|
||||
End If
|
||||
If FotoRuotaADestra = True Then
|
||||
g.RotateFlip(RotateFlipType.Rotate90FlipNone)
|
||||
End If
|
||||
|
||||
Dim thisFormat As System.Drawing.Imaging.ImageFormat = g.RawFormat
|
||||
If _UsaForzaJpg = True Then
|
||||
thisFormat = System.Drawing.Imaging.ImageFormat.Jpeg
|
||||
End If
|
||||
|
||||
Dim thumbSizeSmall As New Size
|
||||
Dim thumbSizeBig As New Size
|
||||
Dim NomeFileSmall As String = ""
|
||||
Dim NomeFileBig As String = ""
|
||||
Dim NomeFileBig2 As String = ""
|
||||
|
||||
If g.Width > g.Height Then
|
||||
thumbSizeSmall = NewthumbSize(g.Width, g.Height, LarghezzaSmall, "Larghezza")
|
||||
Dim SizeOrig As New Size(g.Width, g.Height)
|
||||
thumbSizeBig = SizeOrig
|
||||
Else
|
||||
thumbSizeSmall = NewthumbSize(g.Width, g.Height, AltezzaSmall, "Altezza")
|
||||
Dim SizeOrig As New Size(g.Width, g.Height)
|
||||
thumbSizeBig = SizeOrig
|
||||
End If
|
||||
|
||||
NomeFileSmall = Suffisso & _NomeFileChild
|
||||
NomeFileBig = _NomeFileChild
|
||||
|
||||
Dim imgOutputBig As New Bitmap(g, thumbSizeBig.Width, thumbSizeBig.Height)
|
||||
imgOutputBig.SetResolution(g.HorizontalResolution, g.VerticalResolution)
|
||||
|
||||
If _CreaMiniature = True Then
|
||||
If _AggiungiScritteMiniature = False Then
|
||||
If _DirectorySorgente.ToUpper = _DirectoryDestinazione.ToUpper Then
|
||||
NomeFileSmall = NomeFileSmall.Substring(0, NomeFileSmall.Length - 4) & Codice & NomeFileSmall.Substring(NomeFileSmall.Length - 4)
|
||||
End If
|
||||
If _UsaOrarioMiniatura = True Then
|
||||
If TestoFirmaPiccola.Length > 0 Then
|
||||
Dim imgOutputSmall As Bitmap
|
||||
imgOutputSmall = CType(imgOutputBig.Clone, Bitmap)
|
||||
|
||||
Dim grPhoto1 As Graphics
|
||||
grPhoto1 = Graphics.FromImage(imgOutputSmall)
|
||||
grPhoto1.SmoothingMode = Drawing2D.SmoothingMode.AntiAlias
|
||||
|
||||
Dim crFont1 As Font = Nothing
|
||||
Dim crSize1 As SizeF = New SizeF
|
||||
Dim LarghezzaStandard1 As Integer
|
||||
|
||||
If _Grassetto = True Then
|
||||
crFont1 = New Font(IlFont, DimensioneStandardMiniatura, FontStyle.Bold)
|
||||
Else
|
||||
crFont1 = New Font(_IlFont, DimensioneStandardMiniatura)
|
||||
End If
|
||||
|
||||
crSize1 = grPhoto1.MeasureString(TestoFirmaPiccola, crFont1)
|
||||
LarghezzaStandard1 = CType(crSize1.Width, Integer)
|
||||
|
||||
If crSize1.Width > CType(g.Width, Single) Then
|
||||
Dim Conta As Integer = DimensioneStandardMiniatura
|
||||
Do
|
||||
If Conta > 20 Then
|
||||
Conta -= 5
|
||||
Else
|
||||
Conta -= 1
|
||||
End If
|
||||
If _Grassetto = True Then
|
||||
crFont1 = New Font(_IlFont, Conta, FontStyle.Bold)
|
||||
Else
|
||||
crFont1 = New Font(_IlFont, Conta)
|
||||
End If
|
||||
crSize1 = grPhoto1.MeasureString(TestoFirmaPiccola, crFont1)
|
||||
If crSize1.Width < CType(g.Width, Single) Then
|
||||
LarghezzaStandard1 = CType(crSize1.Width, Integer)
|
||||
Exit Do
|
||||
End If
|
||||
If Conta <= 5 Then Exit Do
|
||||
Loop
|
||||
DimensioneStandardMiniatura = Conta
|
||||
End If
|
||||
|
||||
Dim yPosFromBottom1 As Single
|
||||
Select Case _Posizione.ToUpper
|
||||
Case "ALTO"
|
||||
yPosFromBottom1 = (_Margine)
|
||||
|
||||
Case "BASSO"
|
||||
'yPosFromBottom = (g.Height - _Margine - DimensioneStandard)
|
||||
'yPosFromBottom1 = CType((g.Height - crFont1.Height - (g.Height * _Margine / 100) - (crFont1.Height * 0.3)), Single)
|
||||
yPosFromBottom1 = CType((g.Height - crSize1.Height - (g.Height * _Margine / 100)), Single)
|
||||
|
||||
End Select
|
||||
|
||||
Dim xCenterOfImg1 As Single
|
||||
Dim StrFormat1 As StringFormat = New StringFormat
|
||||
Select Case _Allineamento.ToUpper
|
||||
Case "SINISTRA"
|
||||
xCenterOfImg1 = CType((_Margine + (LarghezzaStandard1 / 2)), Single)
|
||||
If (LarghezzaStandard1 / 2) > (g.Width / 2) - _Margine Then
|
||||
xCenterOfImg1 = CType((g.Width / 2), Single)
|
||||
End If
|
||||
|
||||
Case "CENTRO"
|
||||
xCenterOfImg1 = CType((g.Width / 2), Single)
|
||||
|
||||
Case "DESTRA"
|
||||
xCenterOfImg1 = CType((g.Width - _Margine - (LarghezzaStandard1 / 2)), Single)
|
||||
If (LarghezzaStandard1 / 2) > (g.Width / 2) - _Margine Then
|
||||
xCenterOfImg1 = CType((g.Width / 2), Single)
|
||||
End If
|
||||
|
||||
End Select
|
||||
StrFormat1.Alignment = StringAlignment.Center
|
||||
|
||||
Dim semiTransBrush21 As SolidBrush = New SolidBrush(Color.FromArgb(AlphaScelta, 0, 0, 0))
|
||||
Dim semiTransBrush1 As SolidBrush = New SolidBrush(Color.FromArgb(AlphaScelta, _FontColoreR, _FontColoreG, _FontColoreB))
|
||||
|
||||
If _Grassetto = True Then
|
||||
crFont1 = New Font(_IlFont, DimensioneStandardMiniatura, FontStyle.Bold)
|
||||
Else
|
||||
crFont1 = New Font(_IlFont, DimensioneStandardMiniatura)
|
||||
End If
|
||||
|
||||
grPhoto1.DrawString(TestoFirmaPiccola, crFont1, semiTransBrush21, New PointF(xCenterOfImg1 + 1, yPosFromBottom1 + 1), StrFormat1)
|
||||
grPhoto1.DrawString(TestoFirmaPiccola, crFont1, semiTransBrush1, New PointF(xCenterOfImg1, yPosFromBottom1), StrFormat1)
|
||||
|
||||
imgOutputSmall.Save(Path.Combine(_DestDir.FullName, "Temp_" & NomeFileSmall), thisFormat)
|
||||
Dim g2 As System.Drawing.Image = System.Drawing.Image.FromFile(Path.Combine(_DestDir.FullName, "Temp_" & NomeFileSmall))
|
||||
Dim imgOutputSmall2 As New Bitmap(g2, thumbSizeSmall.Width, thumbSizeSmall.Height)
|
||||
imgOutputSmall2.Save(Path.Combine(_DestDir.FullName, NomeFileSmall), thisFormat)
|
||||
|
||||
imgOutputSmall2.Dispose()
|
||||
imgOutputSmall.Dispose()
|
||||
g2.Dispose()
|
||||
Kill(Path.Combine(_DestDir.FullName, "Temp_" & NomeFileSmall))
|
||||
Else
|
||||
Dim imgOutputSmall As New Bitmap(g, thumbSizeSmall.Width, thumbSizeSmall.Height)
|
||||
imgOutputSmall.Save(Path.Combine(_DestDir.FullName, NomeFileSmall), thisFormat)
|
||||
imgOutputSmall.Dispose()
|
||||
End If
|
||||
Else
|
||||
Dim imgOutputSmall As New Bitmap(g, thumbSizeSmall.Width, thumbSizeSmall.Height)
|
||||
imgOutputSmall.Save(Path.Combine(_DestDir.FullName, NomeFileSmall), thisFormat)
|
||||
imgOutputSmall.Dispose()
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
|
||||
Dim grPhoto As Graphics
|
||||
grPhoto = Graphics.FromImage(imgOutputBig)
|
||||
grPhoto.SmoothingMode = Drawing2D.SmoothingMode.AntiAlias
|
||||
|
||||
Dim crFont As Font = Nothing
|
||||
Dim crSize As SizeF = New SizeF
|
||||
Dim LarghezzaStandard As Integer
|
||||
|
||||
If _Grassetto = True Then
|
||||
crFont = New Font(_IlFont, DimensioneStandard, FontStyle.Bold)
|
||||
Else
|
||||
crFont = New Font(_IlFont, DimensioneStandard)
|
||||
End If
|
||||
crSize = grPhoto.MeasureString(TestoFirma, crFont)
|
||||
LarghezzaStandard = CType(crSize.Width, Integer)
|
||||
|
||||
If crSize.Width > CType(g.Width, Single) Then
|
||||
Dim Conta As Integer = DimensioneStandard
|
||||
Do
|
||||
If Conta > 20 Then
|
||||
Conta -= 5
|
||||
Else
|
||||
Conta -= 1
|
||||
End If
|
||||
If _Grassetto = True Then
|
||||
crFont = New Font(_IlFont, Conta, FontStyle.Bold)
|
||||
Else
|
||||
crFont = New Font(_IlFont, Conta)
|
||||
End If
|
||||
crSize = grPhoto.MeasureString(TestoFirma, crFont)
|
||||
If crSize.Width < CType(g.Width, Single) Then
|
||||
LarghezzaStandard = CType(crSize.Width, Integer)
|
||||
Exit Do
|
||||
End If
|
||||
If Conta <= 5 Then Exit Do
|
||||
Loop
|
||||
DimensioneStandard = Conta
|
||||
End If
|
||||
|
||||
Dim yPosFromBottom As Single
|
||||
Select Case _Posizione.ToUpper
|
||||
Case "ALTO"
|
||||
yPosFromBottom = (_Margine)
|
||||
|
||||
Case "BASSO"
|
||||
'yPosFromBottom = (g.Height - _Margine - DimensioneStandard)
|
||||
'yPosFromBottom = CType((g.Height - DimensioneStandard - (g.Height * _Margine / 100) - (DimensioneStandard * 0.3)), Single)
|
||||
yPosFromBottom = CType((g.Height - crSize.Height - (g.Height * _Margine / 100)), Single)
|
||||
End Select
|
||||
|
||||
Dim xCenterOfImg As Single
|
||||
Dim StrFormat As StringFormat = New StringFormat
|
||||
Select Case _Allineamento.ToUpper
|
||||
Case "SINISTRA"
|
||||
xCenterOfImg = CType((_Margine + (LarghezzaStandard / 2)), Single)
|
||||
If (LarghezzaStandard / 2) > (g.Width / 2) - _Margine Then
|
||||
xCenterOfImg = CType((g.Width / 2), Single)
|
||||
End If
|
||||
|
||||
Case "CENTRO"
|
||||
xCenterOfImg = CType((g.Width / 2), Single)
|
||||
|
||||
Case "DESTRA"
|
||||
xCenterOfImg = CType((g.Width - _Margine - (LarghezzaStandard / 2)), Single)
|
||||
If (LarghezzaStandard / 2) > (g.Width / 2) - _Margine Then
|
||||
xCenterOfImg = CType((g.Width / 2), Single)
|
||||
End If
|
||||
|
||||
End Select
|
||||
StrFormat.Alignment = StringAlignment.Center
|
||||
|
||||
Dim semiTransBrush2 As SolidBrush = New SolidBrush(Color.FromArgb(AlphaScelta, 0, 0, 0))
|
||||
Dim semiTransBrush As SolidBrush = New SolidBrush(Color.FromArgb(AlphaScelta, _FontColoreR, _FontColoreG, _FontColoreB))
|
||||
|
||||
If _Grassetto = True Then
|
||||
crFont = New Font(_IlFont, DimensioneStandard, FontStyle.Bold)
|
||||
Else
|
||||
crFont = New Font(_IlFont, DimensioneStandard)
|
||||
End If
|
||||
|
||||
grPhoto.DrawString(TestoFirma, crFont, semiTransBrush2, New PointF(xCenterOfImg + 1, yPosFromBottom + 1), StrFormat)
|
||||
grPhoto.DrawString(TestoFirma, crFont, semiTransBrush, New PointF(xCenterOfImg, yPosFromBottom), StrFormat)
|
||||
|
||||
If _DirectorySorgente.ToUpper = _DirectoryDestinazione.ToUpper Then
|
||||
NomeFileBig2 = NomeFileBig
|
||||
NomeFileBig = NomeFileBig.Substring(0, NomeFileBig.Length - 4) & Codice & NomeFileBig.Substring(NomeFileBig.Length - 4)
|
||||
End If
|
||||
|
||||
|
||||
'imgOutputBig
|
||||
If _LogoAggiungi = True And File.Exists(_LogoNomeFile) Then
|
||||
|
||||
Dim ImmagineLogo As Image = Image.FromFile(_LogoNomeFile)
|
||||
|
||||
Dim LogoColoreTrasparente As Color = Color.White
|
||||
'Dim bmWatermark As Bitmap
|
||||
|
||||
'* Create a Bitmap based on the previously modified photograph Bitmap
|
||||
'bmWatermark = New Bitmap(imgOutputBig)
|
||||
'bmWatermark.SetResolution(imgOutputBig.HorizontalResolution, imgOutputBig.VerticalResolution)
|
||||
|
||||
'* Load this Bitmap into a new Graphic Object
|
||||
Dim grWatermark As Graphics = Graphics.FromImage(imgOutputBig)
|
||||
|
||||
'* To achieve a transulcent watermark we will apply (2) color manipulations
|
||||
Dim imageAttributes As Imaging.ImageAttributes = New Imaging.ImageAttributes
|
||||
|
||||
'* The first step replace the background color with one that is trasparent (Alpha=0, R=0, G=0, B=0)
|
||||
Dim colorMap As Imaging.ColorMap = New Imaging.ColorMap
|
||||
|
||||
'* background this will be the color we search for and replace with transparency
|
||||
colorMap.OldColor = LogoColoreTrasparente
|
||||
colorMap.NewColor = Color.FromArgb(0, 0, 0, 0)
|
||||
|
||||
Dim remapTable As Imaging.ColorMap() = {colorMap}
|
||||
imageAttributes.SetRemapTable(remapTable, Imaging.ColorAdjustType.Bitmap)
|
||||
|
||||
'* The second color manipulation is used to change the opacity by setting the 3rd row and 3rd column to 0.3f
|
||||
Dim colorMatrixElements As Single()() = {New Single() {1.0F, 0.0F, 0.0F, 0.0F, 0.0F}, New Single() {0.0F, 1.0F, 0.0F, 0.0F, 0.0F}, New Single() {0.0F, 0.0F, 1.0F, 0.0F, 0.0F}, New Single() {0.0F, 0.0F, 0.0F, CType(_LogoTrasparenza, Single) / 100, 0.0F}, New Single() {0.0F, 0.0F, 0.0F, 0.0F, 1.0F}}
|
||||
Dim wmColorMatrix As Imaging.ColorMatrix = New Imaging.ColorMatrix(colorMatrixElements)
|
||||
imageAttributes.SetColorMatrix(wmColorMatrix, Imaging.ColorMatrixFlag.Default, Imaging.ColorAdjustType.Bitmap)
|
||||
|
||||
Dim FotoLogoH As Integer = _LogoAltezza
|
||||
Dim FotoLogoW As Integer = _LogoLarghezza
|
||||
Dim FattoreAlt As Double = ImmagineLogo.Height / FotoLogoH
|
||||
Dim FattoreLarg As Double = ImmagineLogo.Width / FotoLogoW
|
||||
Dim NuovaSize As Size
|
||||
If FattoreLarg > FattoreAlt Then
|
||||
NuovaSize = NewthumbSize(ImmagineLogo.Width, ImmagineLogo.Height, FotoLogoW, "Larghezza")
|
||||
Else
|
||||
NuovaSize = NewthumbSize(ImmagineLogo.Width, ImmagineLogo.Height, FotoLogoH, "Altezza")
|
||||
End If
|
||||
|
||||
Dim MargineUsato As Integer
|
||||
Dim MargineL As Integer
|
||||
Dim InPercentualeL As Boolean
|
||||
If _LogoMargine.EndsWith("%") = True Then
|
||||
InPercentualeL = True
|
||||
Else
|
||||
InPercentualeL = False
|
||||
End If
|
||||
MargineL = CType(Val(_LogoMargine), Integer)
|
||||
If InPercentualeL = True Then
|
||||
MargineUsato = CType(imgOutputBig.Height * MargineL / 100, Integer)
|
||||
Else
|
||||
MargineUsato = MargineL
|
||||
End If
|
||||
|
||||
Dim xPosOfWm As Integer
|
||||
Dim yPosOfWm As Integer
|
||||
Select Case _LogoPosizioneH.ToUpper
|
||||
Case "SINISTRA", "NESSUNA"
|
||||
xPosOfWm = MargineUsato
|
||||
|
||||
Case "CENTRO"
|
||||
xPosOfWm = CType((imgOutputBig.Width - NuovaSize.Width) / 2, Integer)
|
||||
|
||||
Case "DESTRA"
|
||||
xPosOfWm = ((imgOutputBig.Width - NuovaSize.Width) - MargineUsato)
|
||||
End Select
|
||||
Select Case _LogoPosizioneV.ToUpper
|
||||
Case "ALTO", "NESSUNA"
|
||||
yPosOfWm = MargineUsato
|
||||
|
||||
Case "CENTRO"
|
||||
yPosOfWm = CType((imgOutputBig.Height - NuovaSize.Height) / 2, Integer)
|
||||
|
||||
Case "BASSO"
|
||||
yPosOfWm = ((imgOutputBig.Height - NuovaSize.Height) - MargineUsato)
|
||||
End Select
|
||||
|
||||
grWatermark.DrawImage(ImmagineLogo, New Rectangle(xPosOfWm, yPosOfWm, NuovaSize.Width, NuovaSize.Height), 0, 0, ImmagineLogo.Width, ImmagineLogo.Height, GraphicsUnit.Pixel, imageAttributes)
|
||||
grWatermark.Dispose()
|
||||
End If
|
||||
|
||||
If _FotoGrandeDimOrigina = False Then
|
||||
imgOutputBig.Save(Path.Combine(_DestDir.FullName, "Temp_" & NomeFileBig), thisFormat)
|
||||
Dim g2 As System.Drawing.Image = System.Drawing.Image.FromFile(Path.Combine(_DestDir.FullName, "Temp_" & NomeFileBig))
|
||||
If g2.Width > g2.Height Then
|
||||
thumbSizeBig = NewthumbSize(g2.Width, g2.Height, _LarghezzaBig, "Larghezza")
|
||||
Else
|
||||
thumbSizeBig = NewthumbSize(g2.Width, g2.Height, _AltezzaBig, "Altezza")
|
||||
End If
|
||||
Dim imgOutputBig2 As New Bitmap(g2, thumbSizeBig.Width, thumbSizeBig.Height)
|
||||
imgOutputBig2.Save(Path.Combine(_DestDir.FullName, NomeFileBig), thisFormat)
|
||||
imgOutputBig2.Dispose()
|
||||
imgOutputBig.Dispose()
|
||||
g2.Dispose()
|
||||
Else
|
||||
imgOutputBig.Save(Path.Combine(_DestDir.FullName, NomeFileBig), thisFormat)
|
||||
imgOutputBig.Dispose()
|
||||
End If
|
||||
|
||||
If _CreaMiniature = True Then
|
||||
If _AggiungiScritteMiniature = True Then
|
||||
Dim g1 As System.Drawing.Image
|
||||
If _FotoGrandeDimOrigina = False Then
|
||||
g1 = System.Drawing.Image.FromFile(Path.Combine(_DestDir.FullName, "Temp_" & NomeFileBig))
|
||||
Else
|
||||
g1 = System.Drawing.Image.FromFile(Path.Combine(_DestDir.FullName, NomeFileBig))
|
||||
End If
|
||||
Dim imgOutputSmall As New Bitmap(g1, thumbSizeSmall.Width, thumbSizeSmall.Height)
|
||||
If _DirectorySorgente.ToUpper = _DirectoryDestinazione.ToUpper Then
|
||||
NomeFileSmall = NomeFileSmall.Substring(0, NomeFileSmall.Length - 4) & Codice & NomeFileSmall.Substring(NomeFileSmall.Length - 4)
|
||||
End If
|
||||
imgOutputSmall.Save(Path.Combine(_DestDir.FullName, NomeFileSmall), thisFormat)
|
||||
imgOutputSmall.Dispose()
|
||||
g1.Dispose()
|
||||
End If
|
||||
End If
|
||||
|
||||
If File.Exists(Path.Combine(_DestDir.FullName, "Temp_" & NomeFileBig)) = True Then
|
||||
Kill(Path.Combine(_DestDir.FullName, "Temp_" & NomeFileBig))
|
||||
End If
|
||||
|
||||
g.Dispose()
|
||||
grPhoto.Dispose()
|
||||
|
||||
If _DirectorySorgente.ToUpper = _DirectoryDestinazione.ToUpper Then
|
||||
Kill(Path.Combine(_SourceDir.FullName, NomeFileBig2))
|
||||
End If
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
|
||||
Function NewthumbSize(ByVal currentwidth As Integer, ByVal currentheight As Integer, ByVal MaxPixel As Integer, ByVal TipoSize As String) As Size
|
||||
' Calculate the Size of the New image
|
||||
'*** Larghezza, Altezza, Auto
|
||||
|
||||
Dim tempMultiplier As Double
|
||||
|
||||
If TipoSize.ToUpper = "Larghezza".ToUpper Then
|
||||
tempMultiplier = MaxPixel / currentwidth
|
||||
ElseIf TipoSize.ToUpper = "Altezza".ToUpper Then
|
||||
tempMultiplier = MaxPixel / currentheight
|
||||
Else
|
||||
If currentheight > currentwidth Then ' portrait
|
||||
tempMultiplier = MaxPixel / currentheight
|
||||
Else
|
||||
tempMultiplier = MaxPixel / currentwidth
|
||||
End If
|
||||
End If
|
||||
|
||||
Dim NewSize As New Size(CInt(currentwidth * tempMultiplier), CInt(currentheight * tempMultiplier))
|
||||
|
||||
Return NewSize
|
||||
End Function
|
||||
|
||||
|
||||
|
||||
|
||||
Public Property DirectorySorgente() As String
|
||||
Get
|
||||
Return _DirectorySorgente
|
||||
End Get
|
||||
Set(ByVal value As String)
|
||||
_DirectorySorgente = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property DirectoryDestinazione() As String
|
||||
Get
|
||||
Return _DirectoryDestinazione
|
||||
End Get
|
||||
Set(ByVal value As String)
|
||||
_DirectoryDestinazione = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property SourceDir() As DirectoryInfo
|
||||
Get
|
||||
Return _SourceDir
|
||||
End Get
|
||||
Set(ByVal value As DirectoryInfo)
|
||||
_SourceDir = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property DestDirStart() As DirectoryInfo
|
||||
Get
|
||||
Return _DestDirStart
|
||||
End Get
|
||||
Set(ByVal value As DirectoryInfo)
|
||||
_DestDirStart = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
|
||||
Public Property TestoFirmaStart() As String
|
||||
Get
|
||||
Return _TestoFirmaStart
|
||||
End Get
|
||||
Set(ByVal value As String)
|
||||
_TestoFirmaStart = value
|
||||
End Set
|
||||
End Property
|
||||
Public Property TestoFirmaStartV() As String
|
||||
Get
|
||||
Return _TestoFirmaStartV
|
||||
End Get
|
||||
Set(ByVal value As String)
|
||||
_TestoFirmaStartV = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property DataPartenza() As DateTime
|
||||
Get
|
||||
Return _DataPartenza
|
||||
End Get
|
||||
Set(ByVal value As DateTime)
|
||||
_DataPartenza = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property TestoOrario() As String
|
||||
Get
|
||||
Return _TestoOrario
|
||||
End Get
|
||||
Set(ByVal value As String)
|
||||
_TestoOrario = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property DimStandard() As Integer
|
||||
Get
|
||||
Return _DimStandard
|
||||
End Get
|
||||
Set(ByVal value As Integer)
|
||||
_DimStandard = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property DimStandardMiniatura() As Integer
|
||||
Get
|
||||
Return _DimStandardMiniatura
|
||||
End Get
|
||||
Set(ByVal value As Integer)
|
||||
_DimStandardMiniatura = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property UsaOrarioMiniatura() As Boolean
|
||||
Get
|
||||
Return _UsaOrarioMiniatura
|
||||
End Get
|
||||
Set(ByVal value As Boolean)
|
||||
_UsaOrarioMiniatura = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property UsaOrarioTestoApplicare() As Boolean
|
||||
Get
|
||||
Return _UsaOrarioTestoApplicare
|
||||
End Get
|
||||
Set(ByVal value As Boolean)
|
||||
_UsaOrarioTestoApplicare = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property UsaTempoGaraTestoApplicare() As Boolean
|
||||
Get
|
||||
Return _UsaTempoGaraTestoApplicare
|
||||
End Get
|
||||
Set(ByVal value As Boolean)
|
||||
_UsaTempoGaraTestoApplicare = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property UsaRotazioneAutomatica() As Boolean
|
||||
Get
|
||||
Return _UsaRotazioneAutomatica
|
||||
End Get
|
||||
Set(ByVal value As Boolean)
|
||||
_UsaRotazioneAutomatica = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property UsaForzaJpg() As Boolean
|
||||
Get
|
||||
Return _UsaForzaJpg
|
||||
End Get
|
||||
Set(ByVal value As Boolean)
|
||||
_UsaForzaJpg = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
|
||||
Public Property LarghezzaSmall() As Integer
|
||||
Get
|
||||
Return _LarghezzaSmall
|
||||
End Get
|
||||
Set(ByVal value As Integer)
|
||||
_LarghezzaSmall = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property AltezzaSmall() As Integer
|
||||
Get
|
||||
Return _AltezzaSmall
|
||||
End Get
|
||||
Set(ByVal value As Integer)
|
||||
_AltezzaSmall = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property CreaMiniature() As Boolean
|
||||
Get
|
||||
Return _CreaMiniature
|
||||
End Get
|
||||
Set(ByVal value As Boolean)
|
||||
_CreaMiniature = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property AggiungiScritteMiniature() As Boolean
|
||||
Get
|
||||
Return _AggiungiScritteMiniature
|
||||
End Get
|
||||
Set(ByVal value As Boolean)
|
||||
_AggiungiScritteMiniature = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property NomeFileChild() As String
|
||||
Get
|
||||
Return _NomeFileChild
|
||||
End Get
|
||||
Set(ByVal value As String)
|
||||
_NomeFileChild = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property Suffisso() As String
|
||||
Get
|
||||
Return _Suffisso
|
||||
End Get
|
||||
Set(ByVal value As String)
|
||||
_Suffisso = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property Codice() As String
|
||||
Get
|
||||
Return _Codice
|
||||
End Get
|
||||
Set(ByVal value As String)
|
||||
_Codice = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property Trasparenza() As Integer
|
||||
Get
|
||||
Return _Trasparenza
|
||||
End Get
|
||||
Set(ByVal value As Integer)
|
||||
_Trasparenza = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property IlFont() As String
|
||||
Get
|
||||
Return _IlFont
|
||||
End Get
|
||||
Set(ByVal value As String)
|
||||
_IlFont = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property Grassetto() As Boolean
|
||||
Get
|
||||
Return _Grassetto
|
||||
End Get
|
||||
Set(ByVal value As Boolean)
|
||||
_Grassetto = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property Posizione() As String
|
||||
Get
|
||||
Return _Posizione
|
||||
End Get
|
||||
Set(ByVal value As String)
|
||||
_Posizione = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property Allineamento() As String
|
||||
Get
|
||||
Return _Allineamento
|
||||
End Get
|
||||
Set(ByVal value As String)
|
||||
_Allineamento = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property Margine() As Integer
|
||||
Get
|
||||
Return _Margine
|
||||
End Get
|
||||
Set(ByVal value As Integer)
|
||||
_Margine = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property LogoAltezza() As Integer
|
||||
Get
|
||||
Return _LogoAltezza
|
||||
End Get
|
||||
Set(ByVal value As Integer)
|
||||
_LogoAltezza = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property LogoLarghezza() As Integer
|
||||
Get
|
||||
Return _LogoLarghezza
|
||||
End Get
|
||||
Set(ByVal value As Integer)
|
||||
_LogoLarghezza = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property FontColoreR() As Integer
|
||||
Get
|
||||
Return _FontColoreR
|
||||
End Get
|
||||
Set(ByVal value As Integer)
|
||||
_FontColoreR = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property FontColoreG() As Integer
|
||||
Get
|
||||
Return _FontColoreG
|
||||
End Get
|
||||
Set(ByVal value As Integer)
|
||||
_FontColoreG = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property FontColoreB() As Integer
|
||||
Get
|
||||
Return _FontColoreB
|
||||
End Get
|
||||
Set(ByVal value As Integer)
|
||||
_FontColoreB = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property LogoAggiungi() As Boolean
|
||||
Get
|
||||
Return _LogoAggiungi
|
||||
End Get
|
||||
Set(ByVal value As Boolean)
|
||||
_LogoAggiungi = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property LogoNomeFile() As String
|
||||
Get
|
||||
Return _LogoNomeFile
|
||||
End Get
|
||||
Set(ByVal value As String)
|
||||
_LogoNomeFile = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property LogoTrasparenza() As String
|
||||
Get
|
||||
Return _LogoTrasparenza
|
||||
End Get
|
||||
Set(ByVal value As String)
|
||||
_LogoTrasparenza = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property LogoMargine() As String
|
||||
Get
|
||||
Return _LogoMargine
|
||||
End Get
|
||||
Set(ByVal value As String)
|
||||
_LogoMargine = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property LogoPosizioneH() As String
|
||||
Get
|
||||
Return _LogoPosizioneH
|
||||
End Get
|
||||
Set(ByVal value As String)
|
||||
_LogoPosizioneH = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property LogoPosizioneV() As String
|
||||
Get
|
||||
Return _LogoPosizioneV
|
||||
End Get
|
||||
Set(ByVal value As String)
|
||||
_LogoPosizioneV = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property FotoGrandeDimOrigina() As Boolean
|
||||
Get
|
||||
Return _FotoGrandeDimOrigina
|
||||
End Get
|
||||
Set(ByVal value As Boolean)
|
||||
_FotoGrandeDimOrigina = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property AltezzaBig() As Integer
|
||||
Get
|
||||
Return _AltezzaBig
|
||||
End Get
|
||||
Set(ByVal value As Integer)
|
||||
_AltezzaBig = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property LarghezzaBig() As Integer
|
||||
Get
|
||||
Return _LarghezzaBig
|
||||
End Get
|
||||
Set(ByVal value As Integer)
|
||||
_LarghezzaBig = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property DestDir() As DirectoryInfo
|
||||
Get
|
||||
Return _DestDir
|
||||
End Get
|
||||
Set(ByVal value As DirectoryInfo)
|
||||
_DestDir = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
|
||||
End Class
|
||||
1409
imagecatalog/CreaImmagineSeparateThread.vb
Normal file
1409
imagecatalog/CreaImmagineSeparateThread.vb
Normal file
File diff suppressed because it is too large
Load diff
1068
imagecatalog/ExifReader.vb
Normal file
1068
imagecatalog/ExifReader.vb
Normal file
File diff suppressed because it is too large
Load diff
143
imagecatalog/FileHelper.vb
Normal file
143
imagecatalog/FileHelper.vb
Normal file
|
|
@ -0,0 +1,143 @@
|
|||
Imports System.IO
|
||||
Imports System.Collections.Generic
|
||||
|
||||
Public Class FileHelper
|
||||
'Private dirSourceDest As Dictionary(Of FileInfo, DirectoryInfo)
|
||||
Private filesPerFolder As Integer
|
||||
Private suffix As String
|
||||
Private counterSize As Integer
|
||||
Private numerationType As Integer
|
||||
Private filter As String
|
||||
Private separateFiles As Boolean
|
||||
Private extensions As String = "*.jpg,*.png,*.gif"
|
||||
|
||||
|
||||
Public Enum numerazione
|
||||
Progressiva
|
||||
Files
|
||||
End Enum
|
||||
''' <summary>
|
||||
''' Preparazione per la separazione
|
||||
''' </summary>
|
||||
''' <param name="filesPerFolder"></param>
|
||||
''' <param name="suffix"></param>
|
||||
''' <param name="counterSize"></param>
|
||||
''' <param name="numerationType"></param>
|
||||
''' <remarks></remarks>
|
||||
Public Sub New(ByVal filesPerFolder As Integer, ByVal suffix As String, ByVal counterSize As Integer, ByVal numerationType As Integer)
|
||||
Me.filesPerFolder = filesPerFolder
|
||||
Me.suffix = suffix
|
||||
Me.counterSize = counterSize
|
||||
me.numerationType = numerationType
|
||||
Me.separateFiles = True
|
||||
End Sub
|
||||
|
||||
''' <summary>
|
||||
''' nessuna separazione
|
||||
''' </summary>
|
||||
''' <remarks></remarks>
|
||||
Public Sub New()
|
||||
me.separateFiles = False
|
||||
End Sub
|
||||
|
||||
|
||||
Public Function GetFilesRecursive(ByVal root As DirectoryInfo, ByVal destRoot As DirectoryInfo, ByVal filter As String) As Dictionary(Of FileInfo, DirectoryInfo)
|
||||
Dim dirSourceDest As New Dictionary(Of FileInfo, DirectoryInfo)
|
||||
Dim result As New List(Of FileInfo)
|
||||
|
||||
'Dim stack As New Stack(Of DirectoryInfo)
|
||||
Dim stack As New Stack(Of KeyValuePair(Of DirectoryInfo, DirectoryInfo))
|
||||
|
||||
|
||||
Me.filter = filter
|
||||
Dim pair As New KeyValuePair(Of DirectoryInfo, DirectoryInfo)
|
||||
|
||||
|
||||
'stack.Push(root)
|
||||
stack.Push(New KeyValuePair(Of DirectoryInfo, DirectoryInfo)(root, destRoot))
|
||||
|
||||
Do While (stack.Count > 0)
|
||||
Dim curDirKV As KeyValuePair(Of DirectoryInfo, DirectoryInfo) = stack.Pop
|
||||
'curDirKP = stack.Pop()
|
||||
Dim dir As DirectoryInfo = curDirKV.Key
|
||||
Dim dDir As DirectoryInfo = curDirKV.Value
|
||||
Try
|
||||
'result.AddRange(dir.GetFiles(filter, SearchOption.TopDirectoryOnly))
|
||||
' dividere file qui
|
||||
If filesPerFolder > 0 And separateFiles Then
|
||||
appendDictionary(dirSourceDest, dividiFilesInDir(dir, dDir))
|
||||
Else
|
||||
appendDictionary(dirSourceDest, getAllFilesInDir(dir, dDir))
|
||||
End If
|
||||
|
||||
|
||||
|
||||
For Each subDirectory As DirectoryInfo In dir.GetDirectories
|
||||
stack.Push(New KeyValuePair(Of DirectoryInfo, DirectoryInfo)(subDirectory, New DirectoryInfo(Path.Combine(dDir.FullName, subDirectory.Name))))
|
||||
|
||||
Next
|
||||
Catch ex As Exception
|
||||
|
||||
End Try
|
||||
Loop
|
||||
|
||||
Return dirSourceDest
|
||||
End Function
|
||||
|
||||
Public Function appendDictionary(ByVal dictA As Dictionary(Of FileInfo, DirectoryInfo), ByVal dictB As Dictionary(Of FileInfo, DirectoryInfo)) As Dictionary(Of FileInfo, DirectoryInfo)
|
||||
For Each pair As KeyValuePair(Of FileInfo, DirectoryInfo) In dictB
|
||||
dictA.Add(pair.Key, pair.Value)
|
||||
Next
|
||||
Return dictA
|
||||
End Function
|
||||
|
||||
Public Function getAllFilesInDir(dir As DirectoryInfo, dirDest As DirectoryInfo) As Dictionary(Of FileInfo, DirectoryInfo)
|
||||
Dim dict As New Dictionary(Of FileInfo, DirectoryInfo)
|
||||
For Each File As FileInfo In dir.GetFiles(filter)
|
||||
dict.Add(File, New DirectoryInfo(Path.Combine(dirDest.FullName, File.Name)))
|
||||
|
||||
Next
|
||||
Return dict
|
||||
End Function
|
||||
|
||||
Private Function dividiFilesInDir(dir As DirectoryInfo, dirDest As DirectoryInfo) As Dictionary(Of FileInfo, DirectoryInfo)
|
||||
Dim filesCount As Integer = dir.GetFiles(filter).Count
|
||||
Dim contaFilePerDir As Integer = 0
|
||||
Dim contaDirPerDir As Integer = 0
|
||||
Dim tempText As String = String.Empty
|
||||
Dim foldersDict As New Dictionary(Of FileInfo, DirectoryInfo)
|
||||
|
||||
Dim destDir As DirectoryInfo
|
||||
destDir = New DirectoryInfo(Path.Combine(dirDest.FullName))
|
||||
For Each file As FileInfo In dir.GetFiles(filter)
|
||||
|
||||
contaFilePerDir += 1
|
||||
|
||||
If contaFilePerDir = (contaDirPerDir * filesPerFolder) + 1 Then
|
||||
contaDirPerDir += 1
|
||||
|
||||
If numerationType = numerazione.Progressiva Then
|
||||
tempText = contaDirPerDir.ToString
|
||||
Else
|
||||
tempText = (contaDirPerDir * filesPerFolder).ToString
|
||||
End If
|
||||
Dim i As Integer
|
||||
For i = 1 To (counterSize - tempText.Length)
|
||||
tempText = "0" & tempText
|
||||
Next
|
||||
destDir = New DirectoryInfo(Path.Combine(dirDest.FullName, suffix + tempText))
|
||||
|
||||
|
||||
|
||||
End If
|
||||
|
||||
If Not destDir.Exists Then
|
||||
destDir.Create()
|
||||
End If
|
||||
|
||||
foldersDict.Add(file, destDir)
|
||||
Next
|
||||
|
||||
Return foldersDict
|
||||
End Function
|
||||
End Class
|
||||
120
imagecatalog/Form1.resx
Normal file
120
imagecatalog/Form1.resx
Normal file
|
|
@ -0,0 +1,120 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
||||
2945
imagecatalog/Form1.vb
Normal file
2945
imagecatalog/Form1.vb
Normal file
File diff suppressed because it is too large
Load diff
297
imagecatalog/ImageCatalog 2.vbproj
Normal file
297
imagecatalog/ImageCatalog 2.vbproj
Normal file
|
|
@ -0,0 +1,297 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<ProjectType>Local</ProjectType>
|
||||
<ProductVersion>9.0.30729</ProductVersion>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<ProjectGuid>{8D3AA2B0-8F06-4A61-9CAD-B920EB1A8E9C}</ProjectGuid>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ApplicationIcon>
|
||||
</ApplicationIcon>
|
||||
<AssemblyKeyContainerName>
|
||||
</AssemblyKeyContainerName>
|
||||
<AssemblyName>ImageCatalog</AssemblyName>
|
||||
<AssemblyOriginatorKeyFile>
|
||||
</AssemblyOriginatorKeyFile>
|
||||
<AssemblyOriginatorKeyMode>None</AssemblyOriginatorKeyMode>
|
||||
<DefaultClientScript>JScript</DefaultClientScript>
|
||||
<DefaultHTMLPageLayout>Grid</DefaultHTMLPageLayout>
|
||||
<DefaultTargetSchema>IE50</DefaultTargetSchema>
|
||||
<DelaySign>false</DelaySign>
|
||||
<OutputType>WinExe</OutputType>
|
||||
<OptionCompare>Binary</OptionCompare>
|
||||
<OptionExplicit>On</OptionExplicit>
|
||||
<OptionStrict>On</OptionStrict>
|
||||
<RootNamespace>ImageCatalog</RootNamespace>
|
||||
<StartupObject>ImageCatalog.My.MyApplication</StartupObject>
|
||||
<FileUpgradeFlags>
|
||||
</FileUpgradeFlags>
|
||||
<MyType>WindowsForms</MyType>
|
||||
<OldToolsVersion>3.5</OldToolsVersion>
|
||||
<UpgradeBackupLocation>
|
||||
</UpgradeBackupLocation>
|
||||
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
|
||||
<IsWebBootstrapper>true</IsWebBootstrapper>
|
||||
<ApplicationManifest>My Project\app.manifest</ApplicationManifest>
|
||||
<TargetFrameworkProfile>Client</TargetFrameworkProfile>
|
||||
<PublishUrl>http://localhost/ImageCatalog/</PublishUrl>
|
||||
<Install>true</Install>
|
||||
<InstallFrom>Web</InstallFrom>
|
||||
<UpdateEnabled>true</UpdateEnabled>
|
||||
<UpdateMode>Foreground</UpdateMode>
|
||||
<UpdateInterval>7</UpdateInterval>
|
||||
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
|
||||
<UpdatePeriodically>false</UpdatePeriodically>
|
||||
<UpdateRequired>false</UpdateRequired>
|
||||
<MapFileExtensions>true</MapFileExtensions>
|
||||
<ApplicationRevision>0</ApplicationRevision>
|
||||
<ApplicationVersion>1.8.0.%2a</ApplicationVersion>
|
||||
<UseApplicationTrust>false</UseApplicationTrust>
|
||||
<BootstrapperEnabled>true</BootstrapperEnabled>
|
||||
<SccProjectName>SAK</SccProjectName>
|
||||
<SccLocalPath>SAK</SccLocalPath>
|
||||
<SccAuxPath>SAK</SccAuxPath>
|
||||
<SccProvider>SAK</SccProvider>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<OutputPath>bin\</OutputPath>
|
||||
<DocumentationFile>ImageCatalog.xml</DocumentationFile>
|
||||
<BaseAddress>285212672</BaseAddress>
|
||||
<ConfigurationOverrideFile>
|
||||
</ConfigurationOverrideFile>
|
||||
<DefineConstants>
|
||||
</DefineConstants>
|
||||
<DefineDebug>true</DefineDebug>
|
||||
<DefineTrace>true</DefineTrace>
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<Optimize>false</Optimize>
|
||||
<RegisterForComInterop>false</RegisterForComInterop>
|
||||
<RemoveIntegerChecks>false</RemoveIntegerChecks>
|
||||
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
|
||||
<WarningLevel>1</WarningLevel>
|
||||
<NoWarn>42016,42017,42018,42019,42032,42353,42354,42355</NoWarn>
|
||||
<DebugType>full</DebugType>
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<OutputPath>bin\</OutputPath>
|
||||
<DocumentationFile>ImageCatalog.xml</DocumentationFile>
|
||||
<BaseAddress>285212672</BaseAddress>
|
||||
<ConfigurationOverrideFile>
|
||||
</ConfigurationOverrideFile>
|
||||
<DefineConstants>
|
||||
</DefineConstants>
|
||||
<DefineDebug>false</DefineDebug>
|
||||
<DefineTrace>true</DefineTrace>
|
||||
<DebugSymbols>false</DebugSymbols>
|
||||
<Optimize>true</Optimize>
|
||||
<RegisterForComInterop>false</RegisterForComInterop>
|
||||
<RemoveIntegerChecks>false</RemoveIntegerChecks>
|
||||
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
|
||||
<WarningLevel>1</WarningLevel>
|
||||
<NoWarn>42016,42017,42018,42019,42032,42353,42354,42355</NoWarn>
|
||||
<DebugType>none</DebugType>
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x64' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DefineDebug>true</DefineDebug>
|
||||
<DefineTrace>true</DefineTrace>
|
||||
<OutputPath>bin\x64\Debug\</OutputPath>
|
||||
<BaseAddress>285212672</BaseAddress>
|
||||
<DocumentationFile>ImageCatalog.xml</DocumentationFile>
|
||||
<WarningLevel>1</WarningLevel>
|
||||
<NoWarn>42016,42017,42018,42019,42032,42353,42354,42355</NoWarn>
|
||||
<DebugType>full</DebugType>
|
||||
<PlatformTarget>x64</PlatformTarget>
|
||||
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x64' ">
|
||||
<DefineTrace>true</DefineTrace>
|
||||
<OutputPath>bin\x64\Release\</OutputPath>
|
||||
<BaseAddress>285212672</BaseAddress>
|
||||
<DocumentationFile>ImageCatalog.xml</DocumentationFile>
|
||||
<Optimize>true</Optimize>
|
||||
<WarningLevel>1</WarningLevel>
|
||||
<NoWarn>42016,42017,42018,42019,42032,42353,42354,42355</NoWarn>
|
||||
<PlatformTarget>x64</PlatformTarget>
|
||||
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DefineDebug>true</DefineDebug>
|
||||
<DefineTrace>true</DefineTrace>
|
||||
<OutputPath>bin\x86\Debug\</OutputPath>
|
||||
<BaseAddress>285212672</BaseAddress>
|
||||
<DocumentationFile>ImageCatalog.xml</DocumentationFile>
|
||||
<WarningLevel>1</WarningLevel>
|
||||
<NoWarn>42016,42017,42018,42019,42032,42353,42354,42355</NoWarn>
|
||||
<DebugType>full</DebugType>
|
||||
<PlatformTarget>x86</PlatformTarget>
|
||||
<CodeAnalysisLogFile>bin\ImageCatalog.exe.CodeAnalysisLog.xml</CodeAnalysisLogFile>
|
||||
<CodeAnalysisUseTypeNameInSuppression>true</CodeAnalysisUseTypeNameInSuppression>
|
||||
<CodeAnalysisModuleSuppressionsFile>GlobalSuppressions.vb</CodeAnalysisModuleSuppressionsFile>
|
||||
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
|
||||
<CodeAnalysisRuleSetDirectories>;F:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\\Rule Sets</CodeAnalysisRuleSetDirectories>
|
||||
<CodeAnalysisIgnoreBuiltInRuleSets>true</CodeAnalysisIgnoreBuiltInRuleSets>
|
||||
<CodeAnalysisRuleDirectories>;F:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\FxCop\\Rules</CodeAnalysisRuleDirectories>
|
||||
<CodeAnalysisIgnoreBuiltInRules>true</CodeAnalysisIgnoreBuiltInRules>
|
||||
<CodeAnalysisFailOnMissingRules>false</CodeAnalysisFailOnMissingRules>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
|
||||
<DefineTrace>true</DefineTrace>
|
||||
<OutputPath>bin\x86\Release\</OutputPath>
|
||||
<BaseAddress>285212672</BaseAddress>
|
||||
<DocumentationFile>ImageCatalog.xml</DocumentationFile>
|
||||
<Optimize>true</Optimize>
|
||||
<WarningLevel>1</WarningLevel>
|
||||
<NoWarn>42016,42017,42018,42019,42032,42353,42354,42355</NoWarn>
|
||||
<PlatformTarget>x86</PlatformTarget>
|
||||
<CodeAnalysisLogFile>bin\ImageCatalog.exe.CodeAnalysisLog.xml</CodeAnalysisLogFile>
|
||||
<CodeAnalysisUseTypeNameInSuppression>true</CodeAnalysisUseTypeNameInSuppression>
|
||||
<CodeAnalysisModuleSuppressionsFile>GlobalSuppressions.vb</CodeAnalysisModuleSuppressionsFile>
|
||||
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
|
||||
<CodeAnalysisRuleSetDirectories>;F:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\\Rule Sets</CodeAnalysisRuleSetDirectories>
|
||||
<CodeAnalysisIgnoreBuiltInRuleSets>true</CodeAnalysisIgnoreBuiltInRuleSets>
|
||||
<CodeAnalysisRuleDirectories>;F:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\FxCop\\Rules</CodeAnalysisRuleDirectories>
|
||||
<CodeAnalysisIgnoreBuiltInRules>true</CodeAnalysisIgnoreBuiltInRules>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="Microsoft.VisualBasic.PowerPacks.Vs, Version=10.0.0.0" />
|
||||
<Reference Include="System">
|
||||
<Name>System</Name>
|
||||
</Reference>
|
||||
<Reference Include="System.Core">
|
||||
<RequiredTargetFramework>3.5</RequiredTargetFramework>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="System.Data">
|
||||
<Name>System.Data</Name>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="System.Drawing">
|
||||
<Name>System.Drawing</Name>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="System.Windows.Forms">
|
||||
<Name>System.Windows.Forms</Name>
|
||||
</Reference>
|
||||
<Reference Include="System.Xml">
|
||||
<Name>System.XML</Name>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Import Include="Microsoft.VisualBasic" />
|
||||
<Import Include="System" />
|
||||
<Import Include="System.Collections" />
|
||||
<Import Include="System.Data" />
|
||||
<Import Include="System.Diagnostics" />
|
||||
<Import Include="System.Drawing" />
|
||||
<Import Include="System.Linq" />
|
||||
<Import Include="System.Windows.Forms" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="AssemblyInfo.vb">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="FileHelper.vb" />
|
||||
<Compile Include="ImageCreator.vb" />
|
||||
<Compile Include="CreaImmagineSeparateMultiCore.vb" />
|
||||
<Compile Include="CreaImmagineSeparateThread.vb" />
|
||||
<Compile Include="ExifReader.vb">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Form1.vb">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="LoadBuffer.vb" />
|
||||
<Compile Include="MainForm.Designer.vb">
|
||||
<DependentUpon>MainForm.vb</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="MainForm.vb">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Module2.vb" />
|
||||
<Compile Include="My Project\Application.Designer.vb">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DependentUpon>Application.myapp</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="My Project\Settings.Designer.vb">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DesignTimeSharedInput>True</DesignTimeSharedInput>
|
||||
<DependentUpon>Settings.settings</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="PicSettings.vb" />
|
||||
<Compile Include="XYThreadPool.vb" />
|
||||
<Compile Include="Module1.vb">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="ParametriSetup.vb">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<EmbeddedResource Include="Form1.resx">
|
||||
<DependentUpon>Form1.vb</DependentUpon>
|
||||
<SubType>Designer</SubType>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="MainForm.resx">
|
||||
<DependentUpon>MainForm.vb</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<None Include="My Project\Application.myapp">
|
||||
<Generator>MyApplicationCodeGenerator</Generator>
|
||||
<LastGenOutput>Application.Designer.vb</LastGenOutput>
|
||||
</None>
|
||||
<None Include="app.config" />
|
||||
<None Include="ClassDiagram1.cd" />
|
||||
<None Include="My Project\app.manifest" />
|
||||
<None Include="My Project\Settings.settings">
|
||||
<CustomToolNamespace>My</CustomToolNamespace>
|
||||
<Generator>SettingsSingleFileGenerator</Generator>
|
||||
<LastGenOutput>Settings.Designer.vb</LastGenOutput>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<BootstrapperPackage Include="Microsoft.Net.Client.3.5">
|
||||
<Visible>False</Visible>
|
||||
<ProductName>.NET Framework 3.5 SP1 Client Profile</ProductName>
|
||||
<Install>false</Install>
|
||||
</BootstrapperPackage>
|
||||
<BootstrapperPackage Include="Microsoft.Net.Framework.2.0">
|
||||
<Visible>False</Visible>
|
||||
<ProductName>.NET Framework 2.0 %28x86%29</ProductName>
|
||||
<Install>false</Install>
|
||||
</BootstrapperPackage>
|
||||
<BootstrapperPackage Include="Microsoft.Net.Framework.3.0">
|
||||
<Visible>False</Visible>
|
||||
<ProductName>.NET Framework 3.0 %28x86%29</ProductName>
|
||||
<Install>false</Install>
|
||||
</BootstrapperPackage>
|
||||
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5">
|
||||
<Visible>False</Visible>
|
||||
<ProductName>.NET Framework 3.5</ProductName>
|
||||
<Install>true</Install>
|
||||
</BootstrapperPackage>
|
||||
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
|
||||
<Visible>False</Visible>
|
||||
<ProductName>.NET Framework 3.5 SP1</ProductName>
|
||||
<Install>false</Install>
|
||||
</BootstrapperPackage>
|
||||
<BootstrapperPackage Include="Microsoft.Windows.Installer.3.1">
|
||||
<Visible>False</Visible>
|
||||
<ProductName>Windows Installer 3.1</ProductName>
|
||||
<Install>true</Install>
|
||||
</BootstrapperPackage>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Folder Include="Sorgenti\" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildBinPath)\Microsoft.VisualBasic.targets" />
|
||||
<PropertyGroup>
|
||||
<PreBuildEvent>
|
||||
</PreBuildEvent>
|
||||
<PostBuildEvent>
|
||||
</PostBuildEvent>
|
||||
</PropertyGroup>
|
||||
</Project>
|
||||
835
imagecatalog/ImageCreator.vb
Normal file
835
imagecatalog/ImageCreator.vb
Normal file
|
|
@ -0,0 +1,835 @@
|
|||
Imports System.IO
|
||||
Imports System.Drawing.Drawing2D
|
||||
Imports System.Drawing.Imaging
|
||||
'Imports System.Threading
|
||||
|
||||
Public Class ImageCreator
|
||||
#Region "dichiarazioni"
|
||||
|
||||
|
||||
Private FotoRuotaADestra As Boolean = False
|
||||
Private FotoRuotaASinistra As Boolean = False
|
||||
|
||||
Private TempMinText As String = ""
|
||||
'Private crFont1 As Font
|
||||
Private _NomeFileChild As String
|
||||
|
||||
Private _SourceDir As DirectoryInfo
|
||||
Private _DestDirStart As DirectoryInfo
|
||||
Private _DestDir As DirectoryInfo
|
||||
|
||||
Private _workFile As FileInfo
|
||||
|
||||
Private testoFirma As String
|
||||
Private testoFirmaV As String
|
||||
Private alphaScelta As Integer
|
||||
Private DimensioneStandard As Integer
|
||||
Private DimensioneStandardMiniatura As Integer
|
||||
Private dataFoto As DateTime
|
||||
Private dataPartenzaI As DateTime
|
||||
Private testoOrario As String
|
||||
Private testoFirmaPiccola As String
|
||||
Private thumbSizeSmall As Size
|
||||
Private thumbSizeBig As Size
|
||||
Private nomeFileSmall As String
|
||||
Private nomeFileBig As String
|
||||
Private nomeFileBig2 As String
|
||||
|
||||
Private yPosFromBottom As Single
|
||||
Private yPosFromBottom1 As Single
|
||||
Private yPosFromBottom2 As Single
|
||||
Private yPosFromBottom3 As Single
|
||||
Private yPosFromBottom4 As Single
|
||||
#End Region
|
||||
|
||||
Public Sub New()
|
||||
|
||||
End Sub
|
||||
|
||||
Public Sub New(ByVal nomeFileChild As String, ByVal sourceDir As DirectoryInfo, ByVal destDir As DirectoryInfo, ByVal destDirStart As DirectoryInfo)
|
||||
Me.NomeFileChild = nomeFileChild
|
||||
Me.SourceDir = sourceDir
|
||||
Me.DestDir = destDir
|
||||
Me.DestDirStart = destDirStart
|
||||
Me.WorkFile = New FileInfo(nomeFileChild)
|
||||
End Sub
|
||||
|
||||
Public Sub New(ByVal nomeFileChild As String, ByVal sourceDir As DirectoryInfo, ByVal destDir As DirectoryInfo)
|
||||
Me.NomeFileChild = nomeFileChild
|
||||
Me.DestDir = destDir
|
||||
End Sub
|
||||
|
||||
Public Sub New(ByVal file As FileInfo, ByVal destination As DirectoryInfo)
|
||||
Me.WorkFile = file
|
||||
me.DestDir = destination
|
||||
|
||||
End Sub
|
||||
|
||||
Public Sub CreaImmagineThread(ByVal Info As String)
|
||||
#If Not Debug Then
|
||||
Try
|
||||
#End If
|
||||
preparaVariabili()
|
||||
'Dim g As System.Drawing.Image = System.Drawing.Image.FromFile(Path.Combine(SourceDir.FullName, NomeFileChild))
|
||||
Dim g As System.Drawing.Image = System.Drawing.Image.FromFile(WorkFile.FullName)
|
||||
|
||||
' Imposta testo extra
|
||||
impostaTestoExtra(g)
|
||||
|
||||
' Ruota l'immagine in base ai dati EXIF
|
||||
Rotation(g)
|
||||
|
||||
' Forza jpeg se è selezionata l'opzione
|
||||
Dim thisFormat As System.Drawing.Imaging.ImageFormat = g.RawFormat
|
||||
If PicSettings.UsaForzaJpg = True Then thisFormat = System.Drawing.Imaging.ImageFormat.Jpeg
|
||||
|
||||
prepareThumbnailSize(g)
|
||||
|
||||
Dim imgOutputBig As New Bitmap(g, thumbSizeBig.Width, thumbSizeBig.Height)
|
||||
imgOutputBig.SetResolution(g.HorizontalResolution, g.VerticalResolution)
|
||||
|
||||
' Crea le miniature
|
||||
creaMiniature(g, imgOutputBig, thisFormat)
|
||||
|
||||
aggiungiTesto(g, imgOutputBig)
|
||||
|
||||
aggiungiLogo(imgOutputBig)
|
||||
|
||||
salvaFoto(imgOutputBig, thumbSizeBig, nomeFileBig, nomeFileSmall, thumbSizeSmall, thisFormat)
|
||||
|
||||
g.Dispose()
|
||||
|
||||
GC.Collect()
|
||||
|
||||
PicSettings.mainForm.stepProgressBar()
|
||||
#If Not Debug Then
|
||||
Catch ex As Exception
|
||||
|
||||
|
||||
MessageBox.Show(ex.Message)
|
||||
|
||||
|
||||
End Try
|
||||
#End If
|
||||
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub Rotation(ByRef g As System.Drawing.Image)
|
||||
|
||||
FotoRuotaADestra = False
|
||||
FotoRuotaASinistra = False
|
||||
|
||||
If PicSettings.UsaRotazioneAutomatica = True Then
|
||||
If g.PropertyIdList.Length > 0 Then ' ci sono dati exif
|
||||
Dim DatiExif As New ExifReader(CType(g, Bitmap))
|
||||
|
||||
Select Case DatiExif.Orientation
|
||||
Case ExifReader.Orientations.BottomLeft
|
||||
|
||||
Case ExifReader.Orientations.BottomRight
|
||||
|
||||
Case ExifReader.Orientations.LeftTop
|
||||
|
||||
Case ExifReader.Orientations.LftBottom
|
||||
FotoRuotaASinistra = True
|
||||
Case ExifReader.Orientations.RightBottom
|
||||
|
||||
Case ExifReader.Orientations.RightTop
|
||||
|
||||
Case ExifReader.Orientations.TopLeft
|
||||
|
||||
Case ExifReader.Orientations.TopRight
|
||||
|
||||
End Select
|
||||
End If
|
||||
End If
|
||||
|
||||
If FotoRuotaASinistra = True Then
|
||||
g.RotateFlip(RotateFlipType.Rotate270FlipNone)
|
||||
End If
|
||||
If FotoRuotaADestra = True Then
|
||||
g.RotateFlip(RotateFlipType.Rotate90FlipNone)
|
||||
End If
|
||||
|
||||
|
||||
|
||||
End Sub
|
||||
''' <summary>
|
||||
''' Aggiunge Orario, tempo gara e altri
|
||||
''' </summary>
|
||||
''' <param name="g">Image</param>
|
||||
''' <remarks></remarks>
|
||||
Private Sub impostaTestoExtra(g As Image)
|
||||
If PicSettings.UsaOrarioTestoApplicare Or
|
||||
PicSettings.UsaTempoGaraTestoApplicare Or
|
||||
PicSettings.UsaOrarioMiniatura Or
|
||||
PicSettings.TestoMin Or
|
||||
PicSettings.AggTempoGaraMin Or
|
||||
PicSettings.AggNumTempMin Then
|
||||
|
||||
If g.PropertyIdList.Length > 0 Then ' ci sono dati exif
|
||||
Dim DatiExif As New ExifReader(CType(g, Bitmap))
|
||||
dataFoto = DatiExif.DateTimeOriginal
|
||||
testoFirma = PicSettings.TestoFirmaStart
|
||||
testoFirmaV = PicSettings.TestoFirmaStartV
|
||||
|
||||
If dataFoto.Year <> 1 Then
|
||||
testoFirmaPiccola = dataFoto.ToShortTimeString
|
||||
If PicSettings.UsaOrarioTestoApplicare = True Then
|
||||
testoFirma &= " " & dataFoto.ToShortDateString & " " & dataFoto.ToLongTimeString
|
||||
testoFirmaV &= " " & dataFoto.ToShortDateString & " " & dataFoto.ToLongTimeString
|
||||
End If
|
||||
If PicSettings.UsaTempoGaraTestoApplicare = True Then
|
||||
Dim Orario As TimeSpan = New TimeSpan(DateDiff(DateInterval.Second, dataPartenzaI, dataFoto) * 10000000)
|
||||
testoFirma &= " " & testoOrario & Orario.Hours.ToString("00") & ":" & Orario.Minutes.ToString("00") & ":" & Orario.Seconds.ToString("00")
|
||||
testoFirmaV &= " " & testoOrario & Orario.Hours.ToString("00") & ":" & Orario.Minutes.ToString("00") & ":" & Orario.Seconds.ToString("00")
|
||||
End If
|
||||
End If
|
||||
|
||||
End If
|
||||
Else
|
||||
testoFirma = PicSettings.TestoFirmaStart
|
||||
testoFirmaV = PicSettings.TestoFirmaStartV
|
||||
|
||||
End If
|
||||
End Sub
|
||||
|
||||
''' <summary>
|
||||
''' Prepara diverse variabili azzerandole, elaborandole e prendendole dalle impostazioni
|
||||
''' </summary>
|
||||
''' <remarks></remarks>
|
||||
Private Sub preparaVariabili()
|
||||
alphaScelta = CType((255 * (100 - PicSettings.Trasparenza) / 100), Integer)
|
||||
testoFirma = ""
|
||||
testoFirmaV = ""
|
||||
dataPartenzaI = PicSettings.DataPartenza
|
||||
testoOrario = PicSettings.TestoOrario
|
||||
If testoOrario.Length > 0 Then testoOrario &= " "
|
||||
testoFirmaPiccola = ""
|
||||
thumbSizeSmall = New Size
|
||||
thumbSizeBig = New Size
|
||||
nomeFileSmall = ""
|
||||
nomeFileBig2 = ""
|
||||
nomeFileBig = ""
|
||||
DimensioneStandard = PicSettings.DimStandard
|
||||
DimensioneStandardMiniatura = PicSettings.DimStandardMiniatura
|
||||
'nomeFileSmall = Suffisso & NomeFileChild
|
||||
'nomeFileBig = NomeFileChild
|
||||
nomeFileSmall = Suffisso & WorkFile.Name
|
||||
nomeFileBig = WorkFile.Name
|
||||
End Sub
|
||||
|
||||
Private Sub prepareThumbnailSize(g As Image)
|
||||
If g.Width > g.Height Then
|
||||
thumbSizeSmall = NewthumbSize(g.Width, g.Height, LarghezzaSmall, "Larghezza")
|
||||
Dim SizeOrig As New Size(g.Width, g.Height)
|
||||
thumbSizeBig = SizeOrig
|
||||
Else
|
||||
thumbSizeSmall = NewthumbSize(g.Width, g.Height, AltezzaSmall, "Altezza")
|
||||
Dim SizeOrig As New Size(g.Width, g.Height)
|
||||
thumbSizeBig = SizeOrig
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub creaMiniature(g As Image, imgOutputBig As Bitmap, thisFormat As ImageFormat)
|
||||
If PicSettings.TestoMin Then
|
||||
testoFirmaPiccola = nomeFileBig
|
||||
ElseIf PicSettings.AggNumTempMin Then
|
||||
testoFirmaPiccola = nomeFileBig + " "
|
||||
End If
|
||||
'Dim yPosFromBottom4 As Single
|
||||
|
||||
Dim crFont1 As Font = Nothing
|
||||
Dim crFont2 As Font = Nothing
|
||||
Dim crSize1 As SizeF = New SizeF
|
||||
Dim crSize2 As SizeF = New SizeF
|
||||
|
||||
If PicSettings.CreaMiniature = True Then
|
||||
If PicSettings.AggiungiScritteMiniature = False Then
|
||||
If PicSettings.DirectorySorgente.ToUpper = PicSettings.DirectoryDestinazione.ToUpper Then
|
||||
nomeFileSmall = nomeFileSmall.Substring(0, nomeFileSmall.Length - 4) & Codice & nomeFileSmall.Substring(nomeFileSmall.Length - 4)
|
||||
End If
|
||||
If PicSettings.UsaOrarioMiniatura Or
|
||||
PicSettings.TestoMin Or
|
||||
PicSettings.AggTempoGaraMin Or
|
||||
PicSettings.AggNumTempMin Then
|
||||
|
||||
If testoFirmaPiccola.Length > 0 Then
|
||||
Dim imgOutputSmall As Bitmap
|
||||
imgOutputSmall = CType(imgOutputBig.Clone, Bitmap)
|
||||
|
||||
Dim grPhoto1 As Graphics
|
||||
grPhoto1 = Graphics.FromImage(imgOutputSmall)
|
||||
grPhoto1.SmoothingMode = Drawing2D.SmoothingMode.AntiAlias
|
||||
|
||||
Dim LarghezzaStandard1 As Integer
|
||||
'quick fix
|
||||
DimensioneStandardMiniatura = 50
|
||||
If PicSettings.Grassetto = True Then
|
||||
crFont1 = New Font(PicSettings.IlFont, DimensioneStandardMiniatura, FontStyle.Bold)
|
||||
crFont2 = New Font(PicSettings.IlFont, DimensioneStandard, FontStyle.Bold)
|
||||
Else
|
||||
crFont1 = New Font(PicSettings.IlFont, DimensioneStandardMiniatura)
|
||||
crFont2 = New Font(PicSettings.IlFont, DimensioneStandard)
|
||||
End If
|
||||
|
||||
crSize1 = grPhoto1.MeasureString(testoFirmaPiccola, crFont1)
|
||||
crSize2 = grPhoto1.MeasureString(testoFirma, crFont1)
|
||||
LarghezzaStandard1 = CType(crSize1.Width, Integer)
|
||||
|
||||
If crSize1.Width > CType(g.Width, Single) Then
|
||||
Dim Conta As Integer = DimensioneStandardMiniatura
|
||||
Do
|
||||
If Conta > 20 Then
|
||||
Conta -= 5
|
||||
Else
|
||||
Conta -= 1
|
||||
End If
|
||||
If PicSettings.Grassetto = True Then
|
||||
crFont1 = New Font(PicSettings.IlFont, Conta, FontStyle.Bold)
|
||||
Else
|
||||
crFont1 = New Font(PicSettings.IlFont, Conta)
|
||||
End If
|
||||
crSize1 = grPhoto1.MeasureString(testoFirmaPiccola, crFont1)
|
||||
If crSize1.Width < CType(g.Width, Single) Then
|
||||
LarghezzaStandard1 = CType(crSize1.Width, Integer)
|
||||
Exit Do
|
||||
End If
|
||||
If Conta <= 5 Then Exit Do
|
||||
Loop
|
||||
DimensioneStandardMiniatura = Conta
|
||||
End If
|
||||
|
||||
Select Case PicSettings.Posizione.ToUpper
|
||||
Case "ALTO"
|
||||
yPosFromBottom1 = (PicSettings.Margine)
|
||||
yPosFromBottom4 = (PicSettings.MargVert)
|
||||
|
||||
Case "BASSO"
|
||||
yPosFromBottom1 = CType((g.Height - crSize1.Height - (g.Height * PicSettings.Margine / 100)), Single)
|
||||
yPosFromBottom4 = CType((g.Height - crSize1.Height - (g.Height * PicSettings.MargVert / 100)), Single)
|
||||
|
||||
End Select
|
||||
|
||||
Dim xCenterOfImg1 As Single
|
||||
|
||||
Dim StrFormat1 As StringFormat = New StringFormat
|
||||
Select Case PicSettings.Allineamento.ToUpper
|
||||
Case "SINISTRA"
|
||||
xCenterOfImg1 = CType((PicSettings.Margine + (LarghezzaStandard1 / 2)), Single)
|
||||
|
||||
If (LarghezzaStandard1 / 2) > (g.Width / 2) - PicSettings.Margine Then
|
||||
xCenterOfImg1 = CType((g.Width / 2), Single)
|
||||
End If
|
||||
|
||||
|
||||
Case "CENTRO"
|
||||
xCenterOfImg1 = CType((g.Width / 2), Single)
|
||||
|
||||
|
||||
Case "DESTRA"
|
||||
xCenterOfImg1 = CType((g.Width - PicSettings.Margine - (LarghezzaStandard1 / 2)), Single)
|
||||
|
||||
If (LarghezzaStandard1 / 2) > (g.Width / 2) - PicSettings.Margine Then
|
||||
xCenterOfImg1 = CType((g.Width / 2), Single)
|
||||
End If
|
||||
|
||||
|
||||
End Select
|
||||
StrFormat1.Alignment = StringAlignment.Center
|
||||
|
||||
Dim semiTransBrush21 As SolidBrush = New SolidBrush(Color.FromArgb(alphaScelta, 0, 0, 0))
|
||||
Dim semiTransBrush1 As SolidBrush = New SolidBrush(Color.FromArgb(alphaScelta, PicSettings.fontColoreRGB))
|
||||
|
||||
'quick fix
|
||||
DimensioneStandardMiniatura = PicSettings.DimMin
|
||||
|
||||
If PicSettings.Grassetto = True Then
|
||||
crFont1 = New Font(PicSettings.IlFont, DimensioneStandardMiniatura, FontStyle.Bold)
|
||||
Else
|
||||
crFont1 = New Font(PicSettings.IlFont, DimensioneStandardMiniatura)
|
||||
End If
|
||||
'asdgadfhdfhjgfsjgfjygfdhsdafa
|
||||
If PicSettings.TestoMin Then
|
||||
grPhoto1.DrawString(nomeFileBig, crFont1, semiTransBrush21, New PointF(xCenterOfImg1 + 1, yPosFromBottom1 + 1), StrFormat1)
|
||||
grPhoto1.DrawString(nomeFileBig, crFont1, semiTransBrush1, New PointF(xCenterOfImg1, yPosFromBottom1), StrFormat1)
|
||||
ElseIf PicSettings.AggTempoGaraMin And PicSettings.UsaTempoGaraTestoApplicare Then
|
||||
Dim Orario As TimeSpan = New TimeSpan(DateDiff(DateInterval.Second, dataPartenzaI, dataFoto) * 10000000)
|
||||
Dim tempstr As String = ""
|
||||
|
||||
|
||||
tempstr &= ControlChars.CrLf & testoOrario & Orario.Hours.ToString("00") & ":" & Orario.Minutes.ToString("00") & ":" & Orario.Seconds.ToString("00")
|
||||
|
||||
|
||||
grPhoto1.DrawString(tempstr, crFont1, semiTransBrush21, New PointF(xCenterOfImg1 + 1, yPosFromBottom1 + 1), StrFormat1)
|
||||
grPhoto1.DrawString(tempstr, crFont1, semiTransBrush1, New PointF(xCenterOfImg1, yPosFromBottom1), StrFormat1)
|
||||
|
||||
ElseIf PicSettings.AggNumTempMin Then
|
||||
Dim Orario As TimeSpan = New TimeSpan(DateDiff(DateInterval.Second, dataPartenzaI, dataFoto) * 10000000)
|
||||
Dim tempstr As String = ""
|
||||
tempstr &= nomeFileBig
|
||||
|
||||
tempstr &= ControlChars.CrLf & testoOrario & Orario.Hours.ToString("00") & ":" & Orario.Minutes.ToString("00") & ":" & Orario.Seconds.ToString("00")
|
||||
|
||||
|
||||
grPhoto1.DrawString(tempstr, crFont1, semiTransBrush21, New PointF(xCenterOfImg1 + 1, yPosFromBottom1 + 1), StrFormat1)
|
||||
grPhoto1.DrawString(tempstr, crFont1, semiTransBrush1, New PointF(xCenterOfImg1, yPosFromBottom1), StrFormat1)
|
||||
|
||||
|
||||
Else
|
||||
grPhoto1.DrawString(testoFirmaPiccola, crFont1, semiTransBrush21, New PointF(xCenterOfImg1 + 1, yPosFromBottom1 + 1), StrFormat1)
|
||||
grPhoto1.DrawString(testoFirmaPiccola, crFont1, semiTransBrush1, New PointF(xCenterOfImg1, yPosFromBottom1), StrFormat1)
|
||||
End If
|
||||
|
||||
' Salva la miniatura
|
||||
imgOutputSmall.Save(Path.Combine(DestDir.FullName, "Temp_" & nomeFileSmall), thisFormat)
|
||||
Dim g2 As System.Drawing.Image = System.Drawing.Image.FromFile(Path.Combine(DestDir.FullName, "Temp_" & nomeFileSmall))
|
||||
Dim imgOutputSmall2 As New Bitmap(g2, thumbSizeSmall.Width, thumbSizeSmall.Height)
|
||||
imgOutputSmall2.Save(Path.Combine(DestDir.FullName, nomeFileSmall), thisFormat)
|
||||
|
||||
imgOutputSmall2.Dispose()
|
||||
imgOutputSmall.Dispose()
|
||||
g2.Dispose()
|
||||
Kill(Path.Combine(DestDir.FullName, "Temp_" & nomeFileSmall))
|
||||
Else
|
||||
Dim imgOutputSmall As New Bitmap(g, thumbSizeSmall.Width, thumbSizeSmall.Height)
|
||||
imgOutputSmall.Save(Path.Combine(DestDir.FullName, nomeFileSmall), thisFormat)
|
||||
imgOutputSmall.Dispose()
|
||||
End If
|
||||
Else
|
||||
Dim imgOutputSmall As New Bitmap(g, thumbSizeSmall.Width, thumbSizeSmall.Height)
|
||||
imgOutputSmall.Save(Path.Combine(DestDir.FullName, nomeFileSmall), thisFormat)
|
||||
imgOutputSmall.Dispose()
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub aggiungiTesto(g As Image, imgOutputBig As Bitmap)
|
||||
Dim grPhoto As Graphics
|
||||
grPhoto = Graphics.FromImage(imgOutputBig)
|
||||
grPhoto.SmoothingMode = Drawing2D.SmoothingMode.AntiAlias
|
||||
|
||||
Dim crFont As Font = Nothing
|
||||
Dim crSize As SizeF = New SizeF
|
||||
Dim LarghezzaStandard As Integer
|
||||
|
||||
If PicSettings.Grassetto = True Then
|
||||
crFont = New Font(PicSettings.IlFont, DimensioneStandard, FontStyle.Bold)
|
||||
Else
|
||||
crFont = New Font(PicSettings.IlFont, DimensioneStandard)
|
||||
End If
|
||||
crSize = grPhoto.MeasureString(testoFirma, crFont)
|
||||
LarghezzaStandard = CType(crSize.Width, Integer)
|
||||
|
||||
If crSize.Width > CType(g.Width, Single) Then
|
||||
Dim Conta As Integer = DimensioneStandard
|
||||
Do
|
||||
If Conta > 20 Then
|
||||
Conta -= 5
|
||||
Else
|
||||
Conta -= 1
|
||||
End If
|
||||
If PicSettings.Grassetto = True Then
|
||||
crFont = New Font(PicSettings.IlFont, Conta, FontStyle.Bold)
|
||||
Else
|
||||
crFont = New Font(PicSettings.IlFont, Conta)
|
||||
End If
|
||||
crSize = grPhoto.MeasureString(testoFirma, crFont)
|
||||
If crSize.Width < CType(g.Width, Single) Then
|
||||
LarghezzaStandard = CType(crSize.Width, Integer)
|
||||
Exit Do
|
||||
End If
|
||||
If Conta <= 5 Then Exit Do
|
||||
Loop
|
||||
DimensioneStandard = Conta
|
||||
End If
|
||||
|
||||
|
||||
Select Case PicSettings.Posizione.ToUpper
|
||||
Case "ALTO"
|
||||
yPosFromBottom = (PicSettings.Margine)
|
||||
yPosFromBottom3 = (PicSettings.MargVert)
|
||||
|
||||
Case "BASSO"
|
||||
yPosFromBottom = CType((g.Height - crSize.Height - (g.Height * PicSettings.Margine / 100)), Single)
|
||||
yPosFromBottom3 = CType((g.Height - crSize.Height - (g.Height * PicSettings.MargVert / 100)), Single)
|
||||
End Select
|
||||
|
||||
Dim xCenterOfImg As Single
|
||||
Dim xCenterOfImg3 As Single
|
||||
Dim StrFormat As StringFormat = New StringFormat
|
||||
Select Case PicSettings.Allineamento.ToUpper
|
||||
Case "SINISTRA"
|
||||
xCenterOfImg = CType((PicSettings.Margine + (LarghezzaStandard / 2)), Single)
|
||||
xCenterOfImg3 = CType((PicSettings.MargVert + (LarghezzaStandard / 2)), Single)
|
||||
If (LarghezzaStandard / 2) > (g.Width / 2) - PicSettings.Margine Then
|
||||
xCenterOfImg = CType((g.Width / 2), Single)
|
||||
End If
|
||||
If (LarghezzaStandard / 2) > (g.Width / 2) - PicSettings.MargVert Then
|
||||
xCenterOfImg3 = CType((g.Width / 2), Single)
|
||||
End If
|
||||
|
||||
Case "CENTRO"
|
||||
xCenterOfImg = CType((g.Width / 2), Single)
|
||||
|
||||
Case "DESTRA"
|
||||
xCenterOfImg = CType((g.Width - PicSettings.Margine - (LarghezzaStandard / 2)), Single)
|
||||
xCenterOfImg3 = CType((g.Width - PicSettings.MargVert - (LarghezzaStandard / 2)), Single)
|
||||
If (LarghezzaStandard / 2) > (g.Width / 2) - PicSettings.Margine Then
|
||||
xCenterOfImg = CType((g.Width / 2), Single)
|
||||
End If
|
||||
If (LarghezzaStandard / 2) > (g.Width / 2) - PicSettings.MargVert Then
|
||||
xCenterOfImg3 = CType((g.Width / 2), Single)
|
||||
End If
|
||||
|
||||
End Select
|
||||
StrFormat.Alignment = StringAlignment.Center
|
||||
|
||||
Dim semiTransBrush2 As SolidBrush = New SolidBrush(Color.FromArgb(alphaScelta, 0, 0, 0))
|
||||
'Dim semiTransBrush As SolidBrush = New SolidBrush(Color.FromArgb(AlphaScelta, _FontColoreR, _FontColoreG, _FontColoreB))
|
||||
Dim semiTransBrush As SolidBrush = New SolidBrush(Color.FromArgb(alphaScelta, PicSettings.fontColoreRGB))
|
||||
|
||||
If FotoRuotaADestra Or FotoRuotaASinistra Then
|
||||
|
||||
If PicSettings.Grassetto = True Then
|
||||
crFont = New Font(PicSettings.IlFont, DimVert, FontStyle.Bold)
|
||||
Else
|
||||
crFont = New Font(PicSettings.IlFont, DimVert)
|
||||
End If
|
||||
|
||||
Else
|
||||
|
||||
If PicSettings.Grassetto = True Then
|
||||
crFont = New Font(PicSettings.IlFont, DimensioneStandard, FontStyle.Bold)
|
||||
Else
|
||||
crFont = New Font(PicSettings.IlFont, DimensioneStandard)
|
||||
End If
|
||||
End If
|
||||
|
||||
|
||||
'qui scrive il testo (nomefilebig)
|
||||
If PicSettings.TestoNome Then
|
||||
If NomeData And g.PropertyIdList.Length > 0 Then
|
||||
Dim DatiExif As New ExifReader(CType(g, Bitmap))
|
||||
dataFoto = DatiExif.DateTimeOriginal
|
||||
|
||||
grPhoto.DrawString((nomeFileBig & " " & dataFoto.ToShortDateString), crFont, semiTransBrush2, New PointF(xCenterOfImg + 1, yPosFromBottom + 1), StrFormat)
|
||||
grPhoto.DrawString((nomeFileBig & " " & dataFoto.ToShortDateString), crFont, semiTransBrush, New PointF(xCenterOfImg, yPosFromBottom), StrFormat)
|
||||
Else
|
||||
grPhoto.DrawString(nomeFileBig, crFont, semiTransBrush2, New PointF(xCenterOfImg + 1, yPosFromBottom + 1), StrFormat)
|
||||
grPhoto.DrawString(nomeFileBig, crFont, semiTransBrush, New PointF(xCenterOfImg, yPosFromBottom), StrFormat)
|
||||
|
||||
End If
|
||||
End If
|
||||
|
||||
If PicSettings.TestoNome = False Then
|
||||
If FotoRuotaADestra Or FotoRuotaASinistra Then
|
||||
If PicSettings.TestoMin = False Then
|
||||
|
||||
|
||||
grPhoto.DrawString(testoFirmaV, crFont, semiTransBrush2, New PointF(xCenterOfImg + 1, yPosFromBottom3 + 1), StrFormat)
|
||||
grPhoto.DrawString(testoFirmaV, crFont, semiTransBrush, New PointF(xCenterOfImg, yPosFromBottom3), StrFormat)
|
||||
End If
|
||||
If PicSettings.TestoMin = True Then
|
||||
|
||||
grPhoto.DrawString(testoFirmaV, crFont, semiTransBrush2, New PointF(xCenterOfImg + 1, yPosFromBottom4 + 1), StrFormat)
|
||||
grPhoto.DrawString(testoFirmaV, crFont, semiTransBrush, New PointF(xCenterOfImg, yPosFromBottom4), StrFormat)
|
||||
|
||||
End If
|
||||
Else
|
||||
grPhoto.DrawString(testoFirma, crFont, semiTransBrush2, New PointF(xCenterOfImg + 1, yPosFromBottom + 1), StrFormat)
|
||||
grPhoto.DrawString(testoFirma, crFont, semiTransBrush, New PointF(xCenterOfImg, yPosFromBottom), StrFormat)
|
||||
|
||||
|
||||
End If
|
||||
End If
|
||||
|
||||
If PicSettings.DirectorySorgente.ToUpper = PicSettings.DirectoryDestinazione.ToUpper Then
|
||||
nomeFileBig2 = nomeFileBig
|
||||
nomeFileBig = nomeFileBig.Substring(0, nomeFileBig.Length - 4) & Codice & nomeFileBig.Substring(nomeFileBig.Length - 4)
|
||||
End If
|
||||
grPhoto.Dispose()
|
||||
End Sub
|
||||
|
||||
|
||||
|
||||
|
||||
Private Sub aggiungiLogo(imgOutputBig As Bitmap)
|
||||
'imgOutputBig
|
||||
If PicSettings.LogoAggiungi = True And File.Exists(PicSettings.LogoNomeFile) Then
|
||||
|
||||
Dim ImmagineLogo As Image = Image.FromFile(PicSettings.LogoNomeFile)
|
||||
|
||||
Dim LogoColoreTrasparente As Color = Color.White
|
||||
'Dim bmWatermark As Bitmap
|
||||
|
||||
'* Create a Bitmap based on the previously modified photograph Bitmap
|
||||
'bmWatermark = New Bitmap(imgOutputBig)
|
||||
'bmWatermark.SetResolution(imgOutputBig.HorizontalResolution, imgOutputBig.VerticalResolution)
|
||||
|
||||
'* Load this Bitmap into a new Graphic Object
|
||||
Dim grWatermark As Graphics = Graphics.FromImage(imgOutputBig)
|
||||
|
||||
'* To achieve a translucent watermark we will apply (2) color manipulations
|
||||
Dim imageAttributes As Imaging.ImageAttributes = New Imaging.ImageAttributes
|
||||
|
||||
'* The first step replace the background color with one that is transparent (Alpha=0, R=0, G=0, B=0)
|
||||
Dim colorMap As Imaging.ColorMap = New Imaging.ColorMap
|
||||
|
||||
'* background this will be the color we search for and replace with transparency
|
||||
colorMap.OldColor = LogoColoreTrasparente
|
||||
colorMap.NewColor = Color.FromArgb(0, 0, 0, 0)
|
||||
|
||||
Dim remapTable As Imaging.ColorMap() = {colorMap}
|
||||
imageAttributes.SetRemapTable(remapTable, Imaging.ColorAdjustType.Bitmap)
|
||||
|
||||
'* The second color manipulation is used to change the opacity by setting the 3rd row and 3rd column to 0.3f
|
||||
Dim colorMatrixElements As Single()() = {New Single() {1.0F, 0.0F, 0.0F, 0.0F, 0.0F}, New Single() {0.0F, 1.0F, 0.0F, 0.0F, 0.0F}, New Single() {0.0F, 0.0F, 1.0F, 0.0F, 0.0F}, New Single() {0.0F, 0.0F, 0.0F, CType(PicSettings.LogoTrasparenza, Single) / 100, 0.0F}, New Single() {0.0F, 0.0F, 0.0F, 0.0F, 1.0F}}
|
||||
Dim wmColorMatrix As Imaging.ColorMatrix = New Imaging.ColorMatrix(colorMatrixElements)
|
||||
imageAttributes.SetColorMatrix(wmColorMatrix, Imaging.ColorMatrixFlag.Default, Imaging.ColorAdjustType.Bitmap)
|
||||
|
||||
Dim FotoLogoH As Integer = PicSettings.LogoAltezza
|
||||
Dim FotoLogoW As Integer = PicSettings.LogoLarghezza
|
||||
Dim FattoreAlt As Double = ImmagineLogo.Height / FotoLogoH
|
||||
Dim FattoreLarg As Double = ImmagineLogo.Width / FotoLogoW
|
||||
Dim NuovaSize As Size
|
||||
If FattoreLarg > FattoreAlt Then
|
||||
NuovaSize = NewthumbSize(ImmagineLogo.Width, ImmagineLogo.Height, FotoLogoW, "Larghezza")
|
||||
Else
|
||||
NuovaSize = NewthumbSize(ImmagineLogo.Width, ImmagineLogo.Height, FotoLogoH, "Altezza")
|
||||
End If
|
||||
|
||||
Dim MargineUsato As Integer
|
||||
Dim MargineL As Integer
|
||||
Dim InPercentualeL As Boolean
|
||||
If PicSettings.LogoMargine.EndsWith("%") = True Then
|
||||
InPercentualeL = True
|
||||
Else
|
||||
InPercentualeL = False
|
||||
End If
|
||||
MargineL = CType(Val(PicSettings.LogoMargine), Integer)
|
||||
If InPercentualeL = True Then
|
||||
MargineUsato = CType(imgOutputBig.Height * MargineL / 100, Integer)
|
||||
Else
|
||||
MargineUsato = MargineL
|
||||
End If
|
||||
|
||||
Dim xPosOfWm As Integer
|
||||
Dim yPosOfWm As Integer
|
||||
Select Case PicSettings.LogoPosizioneH.ToUpper
|
||||
Case "SINISTRA", "NESSUNA"
|
||||
xPosOfWm = MargineUsato
|
||||
|
||||
Case "CENTRO"
|
||||
xPosOfWm = CType((imgOutputBig.Width - NuovaSize.Width) / 2, Integer)
|
||||
|
||||
Case "DESTRA"
|
||||
xPosOfWm = ((imgOutputBig.Width - NuovaSize.Width) - MargineUsato)
|
||||
End Select
|
||||
Select Case PicSettings.LogoPosizioneV.ToUpper
|
||||
Case "ALTO", "NESSUNA"
|
||||
yPosOfWm = MargineUsato
|
||||
|
||||
Case "CENTRO"
|
||||
yPosOfWm = CType((imgOutputBig.Height - NuovaSize.Height) / 2, Integer)
|
||||
|
||||
Case "BASSO"
|
||||
yPosOfWm = ((imgOutputBig.Height - NuovaSize.Height) - MargineUsato)
|
||||
End Select
|
||||
|
||||
grWatermark.DrawImage(ImmagineLogo, New Rectangle(xPosOfWm, yPosOfWm, NuovaSize.Width, NuovaSize.Height), 0, 0, ImmagineLogo.Width, ImmagineLogo.Height, GraphicsUnit.Pixel, imageAttributes)
|
||||
grWatermark.Dispose()
|
||||
End If
|
||||
End Sub
|
||||
|
||||
|
||||
Private Sub salvaFoto(imgOutputBig As Bitmap, thumbSizeBig As Size, NomeFileBig As String, NomeFileSmall As String, thumbSizeSmall As Size, thisFormat As ImageFormat)
|
||||
|
||||
If PicSettings.FotoGrandeDimOrigina = False Then
|
||||
'attenzione non controlla se è png
|
||||
'imgOutputBig.Save(Path.Combine(_DestDir.FullName, "Temp_" & NomeFileBig), thisFormat)
|
||||
If thisFormat.Equals(ImageFormat.Jpeg) Then
|
||||
salvaImmagineCustomQuality(imgOutputBig, Path.Combine(DestDir.FullName, "Temp_" & NomeFileBig), jpegQuality)
|
||||
Else
|
||||
imgOutputBig.Save(Path.Combine(_DestDir.FullName, "Temp_" & NomeFileBig), thisFormat)
|
||||
End If
|
||||
|
||||
|
||||
Dim g2 As System.Drawing.Image = System.Drawing.Image.FromFile(Path.Combine(DestDir.FullName, "Temp_" & NomeFileBig))
|
||||
If g2.Width > g2.Height Then
|
||||
thumbSizeBig = NewthumbSize(g2.Width, g2.Height, PicSettings.LarghezzaBig, "Larghezza")
|
||||
Else
|
||||
thumbSizeBig = NewthumbSize(g2.Width, g2.Height, PicSettings.AltezzaBig, "Altezza")
|
||||
End If
|
||||
Dim imgOutputBig2 As New Bitmap(g2, thumbSizeBig.Width, thumbSizeBig.Height)
|
||||
'
|
||||
If thisFormat.Equals(ImageFormat.Jpeg) Then
|
||||
salvaImmagineCustomQuality(imgOutputBig2, Path.Combine(DestDir.FullName, NomeFileBig), jpegQuality)
|
||||
Else
|
||||
imgOutputBig2.Save(Path.Combine(_DestDir.FullName, NomeFileBig), thisFormat)
|
||||
End If
|
||||
|
||||
imgOutputBig2.Dispose()
|
||||
imgOutputBig.Dispose()
|
||||
g2.Dispose()
|
||||
Else
|
||||
'
|
||||
If thisFormat.Equals(ImageFormat.Jpeg) Then
|
||||
salvaImmagineCustomQuality(imgOutputBig, Path.Combine(DestDir.FullName, NomeFileBig), jpegQuality)
|
||||
Else
|
||||
imgOutputBig.Save(Path.Combine(_DestDir.FullName, NomeFileBig), thisFormat)
|
||||
End If
|
||||
|
||||
imgOutputBig.Dispose()
|
||||
End If
|
||||
|
||||
|
||||
If PicSettings.CreaMiniature Then
|
||||
If PicSettings.AggiungiScritteMiniature = True Then
|
||||
Dim g1 As System.Drawing.Image
|
||||
If PicSettings.FotoGrandeDimOrigina = False Then
|
||||
g1 = System.Drawing.Image.FromFile(Path.Combine(DestDir.FullName, "Temp_" & NomeFileBig))
|
||||
Else
|
||||
g1 = System.Drawing.Image.FromFile(Path.Combine(DestDir.FullName, NomeFileBig))
|
||||
End If
|
||||
Dim imgOutputSmall As New Bitmap(g1, thumbSizeSmall.Width, thumbSizeSmall.Height)
|
||||
If PicSettings.DirectorySorgente.ToUpper = PicSettings.DirectoryDestinazione.ToUpper Then
|
||||
NomeFileSmall = NomeFileSmall.Substring(0, NomeFileSmall.Length - 4) & Codice & NomeFileSmall.Substring(NomeFileSmall.Length - 4)
|
||||
End If
|
||||
'
|
||||
If thisFormat.Equals(ImageFormat.Jpeg) Then
|
||||
salvaImmagineCustomQuality(imgOutputSmall, Path.Combine(DestDir.FullName, NomeFileSmall), jpegQualityMin)
|
||||
Else
|
||||
imgOutputSmall.Save(Path.Combine(_DestDir.FullName, NomeFileSmall), thisFormat)
|
||||
End If
|
||||
|
||||
imgOutputSmall.Dispose()
|
||||
g1.Dispose()
|
||||
End If
|
||||
|
||||
|
||||
|
||||
End If
|
||||
|
||||
If File.Exists(Path.Combine(DestDir.FullName, "Temp_" & NomeFileBig)) = True Then
|
||||
Kill(Path.Combine(DestDir.FullName, "Temp_" & NomeFileBig))
|
||||
End If
|
||||
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub salvaImmagineCustomQuality(imageToSave As Bitmap, nomeFileFinale As String, quality As Long)
|
||||
|
||||
Dim JgpEncoder As ImageCodecInfo = GetEncoder(ImageFormat.Jpeg)
|
||||
Dim MyEncoder As Encoder = Encoder.Quality
|
||||
|
||||
Dim MyEncoderParameters As New EncoderParameters(1)
|
||||
|
||||
Dim MyEncoderParameter As New EncoderParameter(MyEncoder, jpegQuality)
|
||||
MyEncoderParameters.Param(0) = MyEncoderParameter
|
||||
imageToSave.Save(nomeFileFinale, JgpEncoder, MyEncoderParameters)
|
||||
imageToSave.Dispose()
|
||||
End Sub
|
||||
|
||||
|
||||
|
||||
Private Function GetEncoder(ByVal format As ImageFormat) As ImageCodecInfo
|
||||
|
||||
Dim codecs As ImageCodecInfo() = ImageCodecInfo.GetImageDecoders()
|
||||
|
||||
Dim codec As ImageCodecInfo
|
||||
For Each codec In codecs
|
||||
If codec.FormatID = format.Guid Then
|
||||
Return codec
|
||||
End If
|
||||
Next codec
|
||||
Return Nothing
|
||||
|
||||
End Function
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' Calculate the Size of the New image
|
||||
''' </summary>
|
||||
''' <param name="currentwidth">Larghezza</param>
|
||||
''' <param name="currentheight">Altezza</param>
|
||||
''' <param name="MaxPixel"></param>
|
||||
''' <param name="TipoSize"></param>
|
||||
''' <returns></returns>
|
||||
''' <remarks></remarks>
|
||||
Private Function NewthumbSize(ByVal currentwidth As Integer, ByVal currentheight As Integer, ByVal MaxPixel As Integer, ByVal TipoSize As String) As Size
|
||||
' e
|
||||
'*** Larghezza, Altezza, Auto
|
||||
|
||||
Dim tempMultiplier As Double
|
||||
|
||||
If TipoSize.ToUpper = "Larghezza".ToUpper Then
|
||||
tempMultiplier = MaxPixel / currentwidth
|
||||
ElseIf TipoSize.ToUpper = "Altezza".ToUpper Then
|
||||
tempMultiplier = MaxPixel / currentheight
|
||||
Else
|
||||
If currentheight > currentwidth Then ' portrait
|
||||
tempMultiplier = MaxPixel / currentheight
|
||||
Else
|
||||
tempMultiplier = MaxPixel / currentwidth
|
||||
End If
|
||||
End If
|
||||
|
||||
Dim NewSize As New Size(CInt(currentwidth * tempMultiplier), CInt(currentheight * tempMultiplier))
|
||||
|
||||
Return NewSize
|
||||
End Function
|
||||
|
||||
Public Property WorkFile() As FileInfo
|
||||
Get
|
||||
Return _workFile
|
||||
End Get
|
||||
Set(value As FileInfo)
|
||||
_workFile = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property DestDir() As DirectoryInfo
|
||||
Get
|
||||
Return _DestDir
|
||||
End Get
|
||||
Set(ByVal value As DirectoryInfo)
|
||||
_DestDir = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property SourceDir() As DirectoryInfo
|
||||
Get
|
||||
Return _SourceDir
|
||||
End Get
|
||||
Set(ByVal value As DirectoryInfo)
|
||||
_SourceDir = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property DestDirStart() As DirectoryInfo
|
||||
Get
|
||||
Return _DestDirStart
|
||||
End Get
|
||||
Set(ByVal value As DirectoryInfo)
|
||||
_DestDirStart = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property NomeFileChild() As String
|
||||
Get
|
||||
Return _NomeFileChild
|
||||
End Get
|
||||
Set(ByVal value As String)
|
||||
_NomeFileChild = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
End Class
|
||||
9
imagecatalog/LoadBuffer.vb
Normal file
9
imagecatalog/LoadBuffer.vb
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
Imports System.Collections.Generic
|
||||
Imports System.IO
|
||||
|
||||
Public Class LoadBuffer
|
||||
Public imageList As New List(Of System.Drawing.Image)
|
||||
Public picSourceList As New List(Of FileInfo)
|
||||
Public dirSourceList As New List(Of List(Of FileInfo))
|
||||
|
||||
End Class
|
||||
1786
imagecatalog/MainForm.Designer.vb
generated
Normal file
1786
imagecatalog/MainForm.Designer.vb
generated
Normal file
File diff suppressed because it is too large
Load diff
120
imagecatalog/MainForm.resx
Normal file
120
imagecatalog/MainForm.resx
Normal file
|
|
@ -0,0 +1,120 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
||||
1328
imagecatalog/MainForm.vb
Normal file
1328
imagecatalog/MainForm.vb
Normal file
File diff suppressed because it is too large
Load diff
155
imagecatalog/Module1.vb
Normal file
155
imagecatalog/Module1.vb
Normal file
|
|
@ -0,0 +1,155 @@
|
|||
Module Module1
|
||||
|
||||
'Sub CaricaIni()
|
||||
' Dim Parola As String
|
||||
' Dim i As Integer
|
||||
' Dim p As Integer
|
||||
|
||||
' If Dir$(NomeIni) <> "" Then
|
||||
' Open NomeIni For Input As #1
|
||||
' Input #1, NumeroMacchine
|
||||
' For i = 1 To NumeroMacchine
|
||||
' Input #1, NomeMacchina(i)
|
||||
' Input #1, CodiceMacchina(i)
|
||||
' Input #1, TempoMacchinaFerma(i)
|
||||
' Input #1, LunghezzaImpulso(i)
|
||||
' Input #1, TempoRegistrazioneDati(i)
|
||||
' Input #1, RangoVelocita(i)
|
||||
' Input #1, MaxVelocita(i)
|
||||
' Input #1, NumeroRulli(i)
|
||||
' Input #1, NumeroFili(i)
|
||||
' Input #1, IndirizzoMacchina(i)
|
||||
' Input #1, StampaAutoMacchina(i)
|
||||
' Next i
|
||||
' Input #1, SettimanaInizio
|
||||
' Input #1, SettimanaFine
|
||||
' Input #1, Chiusura
|
||||
' Input #1, OrarioStampa
|
||||
' Input #1, OrarioStampaSecondi
|
||||
' Input #1, OrarioAccendiProg
|
||||
' Input #1, OrarioSpengiProg
|
||||
' Input #1, NomeDitta
|
||||
' Input #1, StampaAutoGiorno
|
||||
' Input #1, StampaAutoWeek
|
||||
' Input #1, StampaGiornoRiepilogo
|
||||
' Input #1, StampaGiornoGrafTMFA
|
||||
' Input #1, StampaGiornoGrafVel
|
||||
' Input #1, StampaWeekRiepilogo
|
||||
' Input #1, StampaWeekGrafTMFA
|
||||
' Input #1, StampaWeekGrafVel
|
||||
' Input #1, StampanteManuale
|
||||
' Input #1, StampanteAutomatica
|
||||
' Input #1, StampanteNomeAghi
|
||||
' Input #1, StampanteNomeLaser
|
||||
' Input #1, NomePortaComm
|
||||
|
||||
' Input #1, TurniTotali
|
||||
' For p = 1 To TurniTotali
|
||||
' Input #1, TurnoNumero(p)
|
||||
' Input #1, TurnoInizioMinuti(p)
|
||||
' Input #1, TurnoFineMinuti(p)
|
||||
' Input #1, TurnoInizioSecondi(p)
|
||||
' Input #1, TurnoFineSecondi(p)
|
||||
' Next p
|
||||
' Input #1, Parola
|
||||
' Close #1
|
||||
' PassWordAmm = Trim$(Cripta(Parola, ChiaveCriDecri))
|
||||
' End If
|
||||
'End Sub
|
||||
|
||||
'Sub SalvaIni()
|
||||
' Dim Conto As Single
|
||||
' Dim Nomefile As String
|
||||
' Dim NomeDir As String
|
||||
' Dim Testo As String
|
||||
' Dim TestoA As String
|
||||
' Dim i As Integer
|
||||
' Dim k As Integer
|
||||
' Dim p As Integer
|
||||
' Dim Lungo As Integer
|
||||
' Dim Resto As Integer
|
||||
' Dim Primo(3) As String
|
||||
|
||||
' For i = 1 To NumeroMacchine
|
||||
' If Right$(DirectoryProgramma, 1) = "\" Then
|
||||
' NomeDir = DirectoryProgramma + NomeMacchina(i)
|
||||
' Else
|
||||
' NomeDir = DirectoryProgramma + "\" + NomeMacchina(i)
|
||||
' End If
|
||||
' Nomefile = NomeDir + "\" + NomeMacchina(i) + ".SYS"
|
||||
' If Dir$(Nomefile) = "" Then MkDir(NomeDir)
|
||||
' Next i
|
||||
|
||||
'Open NomeIni For Output As #3
|
||||
' Print #3, NumeroMacchine
|
||||
' For i = 1 To NumeroMacchine
|
||||
' If Right$(DirectoryProgramma, 1) = "\" Then
|
||||
' Nomefile = DirectoryProgramma + NomeMacchina(i) + "\" + NomeMacchina(i) + ".SYS"
|
||||
' Else
|
||||
' Nomefile = DirectoryProgramma + "\" + NomeMacchina(i) + "\" + NomeMacchina(i) + ".SYS"
|
||||
' End If
|
||||
' Open Nomefile For Output As #4
|
||||
' Write #4, NomeMacchina(i)
|
||||
' Write #4, CodiceMacchina(i)
|
||||
' Print #4, TempoMacchinaFerma(i)
|
||||
' Print #4, LunghezzaImpulso(i)
|
||||
' Print #4, TempoRegistrazioneDati(i)
|
||||
' Print #4, RangoVelocita(i)
|
||||
' Print #4, MaxVelocita(i)
|
||||
' Print #4, NumeroRulli(i)
|
||||
' Print #4, NumeroFili(i)
|
||||
' Print #4, IndirizzoMacchina(i)
|
||||
' Write #4, StampaAutoMacchina(i)
|
||||
' Close #4
|
||||
' Write #3, NomeMacchina(i)
|
||||
' Write #3, CodiceMacchina(i)
|
||||
' Print #3, TempoMacchinaFerma(i)
|
||||
' Print #3, LunghezzaImpulso(i)
|
||||
' Print #3, TempoRegistrazioneDati(i)
|
||||
' Print #3, RangoVelocita(i)
|
||||
' Print #3, MaxVelocita(i)
|
||||
' Print #3, NumeroRulli(i)
|
||||
' Print #3, NumeroFili(i)
|
||||
' Print #3, IndirizzoMacchina(i)
|
||||
' Write #3, StampaAutoMacchina(i)
|
||||
' Next i
|
||||
' Print #3, SettimanaInizio
|
||||
' Print #3, SettimanaFine
|
||||
' Write #3, Chiusura
|
||||
' Write #3, OrarioStampa
|
||||
' Print #3, OrarioStampaSecondi
|
||||
' Write #3, OrarioAccendiProg
|
||||
' Write #3, OrarioSpengiProg
|
||||
' Write #3, NomeDitta
|
||||
' Write #3, StampaAutoGiorno
|
||||
' Write #3, StampaAutoWeek
|
||||
' Write #3, StampaGiornoRiepilogo
|
||||
' Write #3, StampaGiornoGrafTMFA
|
||||
' Write #3, StampaGiornoGrafVel
|
||||
' Write #3, StampaWeekRiepilogo
|
||||
' Write #3, StampaWeekGrafTMFA
|
||||
' Write #3, StampaWeekGrafVel
|
||||
' Write #3, StampanteManuale
|
||||
' Write #3, StampanteAutomatica
|
||||
' Write #3, StampanteNomeAghi
|
||||
' Write #3, StampanteNomeLaser
|
||||
' Write #3, NomePortaComm
|
||||
|
||||
' Print #3, TurniTotali
|
||||
' For p = 1 To TurniTotali
|
||||
' Print #3, TurnoNumero(p)
|
||||
' Print #3, TurnoInizioMinuti(p)
|
||||
' Print #3, TurnoFineMinuti(p)
|
||||
' Print #3, TurnoInizioSecondi(p)
|
||||
' Print #3, TurnoFineSecondi(p)
|
||||
' Next p
|
||||
' Testo = Cripta(PassWordAmm, ChiaveCriDecri)
|
||||
' Write #3, Testo
|
||||
'Close #3
|
||||
'End Sub
|
||||
|
||||
|
||||
Public SetupIni As New ParametriSetup
|
||||
|
||||
|
||||
End Module
|
||||
3
imagecatalog/Module2.vb
Normal file
3
imagecatalog/Module2.vb
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
Module Module2
|
||||
|
||||
End Module
|
||||
38
imagecatalog/My Project/Application.Designer.vb
generated
Normal file
38
imagecatalog/My Project/Application.Designer.vb
generated
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
'------------------------------------------------------------------------------
|
||||
' <auto-generated>
|
||||
' This code was generated by a tool.
|
||||
' Runtime Version:4.0.30319.18033
|
||||
'
|
||||
' Changes to this file may cause incorrect behavior and will be lost if
|
||||
' the code is regenerated.
|
||||
' </auto-generated>
|
||||
'------------------------------------------------------------------------------
|
||||
|
||||
Option Strict On
|
||||
Option Explicit On
|
||||
|
||||
|
||||
Namespace My
|
||||
|
||||
'NOTE: This file is auto-generated; do not modify it directly. To make changes,
|
||||
' or if you encounter build errors in this file, go to the Project Designer
|
||||
' (go to Project Properties or double-click the My Project node in
|
||||
' Solution Explorer), and make changes on the Application tab.
|
||||
'
|
||||
Partial Friend Class MyApplication
|
||||
|
||||
<Global.System.Diagnostics.DebuggerStepThroughAttribute()> _
|
||||
Public Sub New()
|
||||
MyBase.New(Global.Microsoft.VisualBasic.ApplicationServices.AuthenticationMode.Windows)
|
||||
Me.IsSingleInstance = false
|
||||
Me.EnableVisualStyles = true
|
||||
Me.SaveMySettingsOnExit = true
|
||||
Me.ShutDownStyle = Global.Microsoft.VisualBasic.ApplicationServices.ShutdownMode.AfterMainFormCloses
|
||||
End Sub
|
||||
|
||||
<Global.System.Diagnostics.DebuggerStepThroughAttribute()> _
|
||||
Protected Overrides Sub OnCreateMainForm()
|
||||
Me.MainForm = Global.ImageCatalog.MainForm
|
||||
End Sub
|
||||
End Class
|
||||
End Namespace
|
||||
10
imagecatalog/My Project/Application.myapp
Normal file
10
imagecatalog/My Project/Application.myapp
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<MyApplicationData xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
|
||||
<MySubMain>true</MySubMain>
|
||||
<MainForm>MainForm</MainForm>
|
||||
<SingleInstance>false</SingleInstance>
|
||||
<ShutdownMode>0</ShutdownMode>
|
||||
<EnableVisualStyles>true</EnableVisualStyles>
|
||||
<AuthenticationMode>0</AuthenticationMode>
|
||||
<SaveMySettingsOnExit>true</SaveMySettingsOnExit>
|
||||
</MyApplicationData>
|
||||
73
imagecatalog/My Project/Settings.Designer.vb
generated
Normal file
73
imagecatalog/My Project/Settings.Designer.vb
generated
Normal file
|
|
@ -0,0 +1,73 @@
|
|||
'------------------------------------------------------------------------------
|
||||
' <auto-generated>
|
||||
' This code was generated by a tool.
|
||||
' Runtime Version:4.0.30319.18033
|
||||
'
|
||||
' Changes to this file may cause incorrect behavior and will be lost if
|
||||
' the code is regenerated.
|
||||
' </auto-generated>
|
||||
'------------------------------------------------------------------------------
|
||||
|
||||
Option Strict On
|
||||
Option Explicit On
|
||||
|
||||
|
||||
Namespace My
|
||||
|
||||
<Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(), _
|
||||
Global.System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0"), _
|
||||
Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _
|
||||
Partial Friend NotInheritable Class MySettings
|
||||
Inherits Global.System.Configuration.ApplicationSettingsBase
|
||||
|
||||
Private Shared defaultInstance As MySettings = CType(Global.System.Configuration.ApplicationSettingsBase.Synchronized(New MySettings()),MySettings)
|
||||
|
||||
#Region "My.Settings Auto-Save Functionality"
|
||||
#If _MyType = "WindowsForms" Then
|
||||
Private Shared addedHandler As Boolean
|
||||
|
||||
Private Shared addedHandlerLockObject As New Object
|
||||
|
||||
<Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _
|
||||
Private Shared Sub AutoSaveSettings(ByVal sender As Global.System.Object, ByVal e As Global.System.EventArgs)
|
||||
If My.Application.SaveMySettingsOnExit Then
|
||||
My.Settings.Save()
|
||||
End If
|
||||
End Sub
|
||||
#End If
|
||||
#End Region
|
||||
|
||||
Public Shared ReadOnly Property [Default]() As MySettings
|
||||
Get
|
||||
|
||||
#If _MyType = "WindowsForms" Then
|
||||
If Not addedHandler Then
|
||||
SyncLock addedHandlerLockObject
|
||||
If Not addedHandler Then
|
||||
AddHandler My.Application.Shutdown, AddressOf AutoSaveSettings
|
||||
addedHandler = True
|
||||
End If
|
||||
End SyncLock
|
||||
End If
|
||||
#End If
|
||||
Return defaultInstance
|
||||
End Get
|
||||
End Property
|
||||
End Class
|
||||
End Namespace
|
||||
|
||||
Namespace My
|
||||
|
||||
<Global.Microsoft.VisualBasic.HideModuleNameAttribute(), _
|
||||
Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
|
||||
Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute()> _
|
||||
Friend Module MySettingsProperty
|
||||
|
||||
<Global.System.ComponentModel.Design.HelpKeywordAttribute("My.Settings")> _
|
||||
Friend ReadOnly Property Settings() As Global.ImageCatalog.My.MySettings
|
||||
Get
|
||||
Return Global.ImageCatalog.My.MySettings.Default
|
||||
End Get
|
||||
End Property
|
||||
End Module
|
||||
End Namespace
|
||||
6
imagecatalog/My Project/Settings.settings
Normal file
6
imagecatalog/My Project/Settings.settings
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
<?xml version='1.0' encoding='utf-8'?>
|
||||
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" UseMySettingsClassName="true">
|
||||
<Profiles>
|
||||
<Profile Name="(Default)" />
|
||||
</Profiles>
|
||||
</SettingsFile>
|
||||
22
imagecatalog/My Project/app.manifest
Normal file
22
imagecatalog/My Project/app.manifest
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<asmv1:assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1" xmlns:asmv1="urn:schemas-microsoft-com:asm.v1" xmlns:asmv2="urn:schemas-microsoft-com:asm.v2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
||||
<assemblyIdentity version="1.0.0.0" name="MyApplication.app"/>
|
||||
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
|
||||
<security>
|
||||
<requestedPrivileges xmlns="urn:schemas-microsoft-com:asm.v3">
|
||||
<!-- UAC Manifest Options
|
||||
If you want to change the Windows User Account Control level replace the
|
||||
requestedExecutionLevel node with one of the following.
|
||||
|
||||
<requestedExecutionLevel level="asInvoker" uiAccess="false" />
|
||||
<requestedExecutionLevel level="requireAdministrator" uiAccess="false" />
|
||||
<requestedExecutionLevel level="highestAvailable" uiAccess="false" />
|
||||
|
||||
If you want to utilize File and Registry Virtualization for backward
|
||||
compatibility then delete the requestedExecutionLevel node.
|
||||
-->
|
||||
<requestedExecutionLevel level="asInvoker" uiAccess="false" />
|
||||
</requestedPrivileges>
|
||||
</security>
|
||||
</trustInfo>
|
||||
</asmv1:assembly>
|
||||
148
imagecatalog/ParametriSetup.vb
Normal file
148
imagecatalog/ParametriSetup.vb
Normal file
|
|
@ -0,0 +1,148 @@
|
|||
Public Class ParametriSetup
|
||||
|
||||
|
||||
Private _ElencoParametri As DataSet
|
||||
Private _NomeFileSetup As String
|
||||
|
||||
Public Sub New(ByVal FileSetup As String)
|
||||
_ElencoParametri = New DataSet
|
||||
_NomeFileSetup = FileSetup
|
||||
|
||||
If FileSetup <> "" Then
|
||||
CaricaParametriSetup()
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Public Sub New()
|
||||
_ElencoParametri = New DataSet
|
||||
_NomeFileSetup = ""
|
||||
End Sub
|
||||
|
||||
Public Sub CaricaParametriSetup()
|
||||
_ElencoParametri = LeggiXmlDataSet("Setup", _NomeFileSetup, "Nome")
|
||||
End Sub
|
||||
|
||||
Public Sub SalvaParametriSetup()
|
||||
If System.IO.File.Exists(_NomeFileSetup) = True Then
|
||||
Kill(_NomeFileSetup)
|
||||
End If
|
||||
_ElencoParametri.WriteXml(_NomeFileSetup)
|
||||
End Sub
|
||||
|
||||
Public Function LeggiParametroString(ByVal NomeParametro As String) As String
|
||||
Dim Risposta As String = ""
|
||||
|
||||
Try
|
||||
Dim LElenco As DataRow() = _ElencoParametri.Tables("Setup").Select("Nome='" & NomeParametro & "'")
|
||||
|
||||
Dim LaRiga As DataRow
|
||||
For Each LaRiga In LElenco
|
||||
Risposta = LaRiga("Valore").ToString
|
||||
Next
|
||||
Catch
|
||||
Risposta = ""
|
||||
End Try
|
||||
|
||||
Return Risposta
|
||||
End Function
|
||||
|
||||
Public Function LeggiParametroBoolean(ByVal NomeParametro As String) As Boolean
|
||||
Dim Risposta As String = ""
|
||||
|
||||
Try
|
||||
Dim LElenco As DataRow() = _ElencoParametri.Tables("Setup").Select("Nome='" & NomeParametro & "'")
|
||||
|
||||
Dim LaRiga As DataRow
|
||||
For Each LaRiga In LElenco
|
||||
Risposta = LaRiga("Valore").ToString
|
||||
Next
|
||||
Catch
|
||||
Risposta = ""
|
||||
End Try
|
||||
|
||||
Select Case Risposta.ToUpper
|
||||
Case "TRUE", "OK", "SI", "1", "YES", "VERO"
|
||||
Return True
|
||||
Case Else
|
||||
Return False
|
||||
End Select
|
||||
End Function
|
||||
|
||||
Public Sub AggiornaParametro(ByVal NomeParametro As String, ByVal ValoreParametro As Object)
|
||||
Try
|
||||
If _ElencoParametri.Tables("Setup") Is Nothing Then
|
||||
Dim TabellaTmp As New DataTable("Setup")
|
||||
Dim RigaTmp As DataRow
|
||||
|
||||
Dim LaColonna As DataColumn
|
||||
LaColonna = TabellaTmp.Columns.Add("Nome", System.Type.GetType("System.String"))
|
||||
LaColonna = TabellaTmp.Columns.Add("Valore", System.Type.GetType("System.String"))
|
||||
|
||||
'* Aggiunge alla tabella tutte le righe
|
||||
RigaTmp = TabellaTmp.NewRow
|
||||
RigaTmp("Nome") = NomeParametro
|
||||
RigaTmp("Valore") = ValoreParametro
|
||||
TabellaTmp.Rows.Add(RigaTmp)
|
||||
|
||||
_ElencoParametri.Tables.Add(TabellaTmp)
|
||||
Else
|
||||
Dim LElenco As DataRow() = _ElencoParametri.Tables("Setup").Select("Nome='" & NomeParametro & "'")
|
||||
|
||||
If LElenco.Length = 0 Then
|
||||
Dim LaRiga As DataRow
|
||||
LaRiga = _ElencoParametri.Tables("Setup").NewRow
|
||||
LaRiga("Nome") = NomeParametro
|
||||
LaRiga("Valore") = ValoreParametro
|
||||
_ElencoParametri.Tables("Setup").Rows.Add(LaRiga)
|
||||
Else
|
||||
LElenco(0).Item("Valore") = ValoreParametro
|
||||
End If
|
||||
End If
|
||||
Catch
|
||||
|
||||
End Try
|
||||
End Sub
|
||||
|
||||
|
||||
Private Function LeggiXmlDataTable(ByVal NomeTabella As String, ByVal NomeFileXml As String, Optional ByVal NomeColonnaChiave As String = "") As DataTable
|
||||
'* Crea e Legge il dataset dal file xml
|
||||
Dim DataSetXml As New System.Data.DataSet
|
||||
DataSetXml.ReadXml(NomeFileXml)
|
||||
|
||||
'* Aggiunge il campo chiave
|
||||
If NomeColonnaChiave <> "" Then
|
||||
DataSetXml.Tables(NomeTabella).Constraints.Add(NomeColonnaChiave, DataSetXml.Tables(NomeTabella).Columns(NomeColonnaChiave), True)
|
||||
End If
|
||||
|
||||
'* Restituisce la risposta
|
||||
Return DataSetXml.Tables(NomeTabella)
|
||||
End Function
|
||||
|
||||
Private Shared Function LeggiXmlDataSet(ByVal NomeTabella As String, ByVal NomeFileXml As String, Optional ByVal NomeColonnaChiave As String = "") As DataSet
|
||||
'* Crea e Legge il dataset dal file xml
|
||||
Dim DataSetXml As New System.Data.DataSet
|
||||
DataSetXml.ReadXml(NomeFileXml)
|
||||
|
||||
'* Aggiunge il campo chiave
|
||||
If NomeColonnaChiave <> "" Then
|
||||
DataSetXml.Tables(NomeTabella).Constraints.Add(NomeColonnaChiave, DataSetXml.Tables(NomeTabella).Columns(NomeColonnaChiave), True)
|
||||
End If
|
||||
|
||||
'* Restituisce la risposta
|
||||
Return DataSetXml
|
||||
End Function
|
||||
|
||||
|
||||
|
||||
|
||||
Public Property NomeFileSetup() As String
|
||||
Get
|
||||
Return _NomeFileSetup
|
||||
End Get
|
||||
Set(ByVal Value As String)
|
||||
_NomeFileSetup = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
End Class
|
||||
604
imagecatalog/PicSettings.vb
Normal file
604
imagecatalog/PicSettings.vb
Normal file
|
|
@ -0,0 +1,604 @@
|
|||
Imports System.IO
|
||||
Imports System.Drawing.Drawing2D
|
||||
Imports System.Drawing.Imaging
|
||||
|
||||
Module PicSettings
|
||||
|
||||
Private _DirectorySorgente As String
|
||||
Private _DirectoryDestinazione As String
|
||||
|
||||
Private _DimVert As Integer
|
||||
Private _MargVert As Integer
|
||||
|
||||
|
||||
Private _DimStandard As Integer
|
||||
Private _DimStandardMiniatura As Integer
|
||||
|
||||
Private _NomeData As Boolean
|
||||
Private _TestoNome As Boolean
|
||||
Private _UsaOrarioMiniatura As Boolean
|
||||
Private _UsaOrarioTestoApplicare As Boolean
|
||||
Private _UsaTempoGaraTestoApplicare As Boolean
|
||||
Private _TestoFirmaStart As String
|
||||
Private _TestoFirmaStartV As String
|
||||
Private _DataPartenza As DateTime
|
||||
Private _TestoOrario As String
|
||||
|
||||
Private _UsaRotazioneAutomatica As Boolean
|
||||
Private _UsaForzaJpg As Boolean
|
||||
|
||||
Private _LarghezzaSmall As Integer
|
||||
Private _AltezzaSmall As Integer
|
||||
|
||||
Private _CreaMiniature As Boolean
|
||||
Private _AggiungiScritteMiniature As Boolean
|
||||
Private _AggTempoGaraMin As Boolean
|
||||
Private _AggNumTempMin As Boolean
|
||||
|
||||
Private _Suffisso As String
|
||||
Private _Codice As String
|
||||
|
||||
Private _Trasparenza As Integer
|
||||
Private _IlFont As String
|
||||
Private _Grassetto As Boolean
|
||||
|
||||
Private _Posizione As String
|
||||
Private _Allineamento As String
|
||||
Private _Margine As Integer
|
||||
|
||||
Private _LogoAltezza As Integer
|
||||
Private _LogoLarghezza As Integer
|
||||
|
||||
Private _fontColoreRGB As Color
|
||||
|
||||
Private _LogoAggiungi As Boolean
|
||||
Private _LogoNomeFile As String
|
||||
Private _LogoTrasparenza As String
|
||||
Private _LogoMargine As String
|
||||
Private _LogoPosizioneH As String
|
||||
Private _LogoPosizioneV As String
|
||||
|
||||
Private _FotoGrandeDimOrigina As Boolean
|
||||
Private _AltezzaBig As Integer
|
||||
Private _LarghezzaBig As Integer
|
||||
Private _DestDir As DirectoryInfo
|
||||
Private _DimMin As Integer
|
||||
|
||||
Private _TestoMin As Boolean
|
||||
|
||||
Private _SecretDefault As Boolean
|
||||
Private _SecretBig As Boolean
|
||||
Private _SecretSmall As Boolean
|
||||
|
||||
Private _SecretPathSmall As String
|
||||
Private _SecretPathBig As String
|
||||
|
||||
Private _jpegQuality As Long
|
||||
Private _jpegQualityMin As Long
|
||||
|
||||
Private FotoRuotaADestra As Boolean = False
|
||||
Private FotoRuotaASinistra As Boolean = False
|
||||
|
||||
Private TempMinText As String = ""
|
||||
|
||||
Private _mainForm As MainForm
|
||||
|
||||
'Private progressBar As System.Windows.Forms.ProgressBar
|
||||
|
||||
|
||||
|
||||
Public Property mainForm() As MainForm
|
||||
Get
|
||||
Return _mainForm
|
||||
End Get
|
||||
Set(ByVal value As MainForm)
|
||||
_mainForm = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property DirectorySorgente() As String
|
||||
Get
|
||||
Return _DirectorySorgente
|
||||
End Get
|
||||
Set(ByVal value As String)
|
||||
_DirectorySorgente = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property DirectoryDestinazione() As String
|
||||
Get
|
||||
Return _DirectoryDestinazione
|
||||
End Get
|
||||
Set(ByVal value As String)
|
||||
_DirectoryDestinazione = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property TestoFirmaStart() As String
|
||||
Get
|
||||
Return _TestoFirmaStart
|
||||
End Get
|
||||
Set(ByVal value As String)
|
||||
_TestoFirmaStart = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property TestoFirmaStartV() As String
|
||||
Get
|
||||
Return _TestoFirmaStartV
|
||||
End Get
|
||||
|
||||
Set(ByVal value As String)
|
||||
_TestoFirmaStartV = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property DataPartenza() As DateTime
|
||||
Get
|
||||
Return _DataPartenza
|
||||
End Get
|
||||
Set(ByVal value As DateTime)
|
||||
_DataPartenza = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property TestoOrario() As String
|
||||
Get
|
||||
Return _TestoOrario
|
||||
End Get
|
||||
Set(ByVal value As String)
|
||||
_TestoOrario = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property DimStandard() As Integer
|
||||
Get
|
||||
Return _DimStandard
|
||||
End Get
|
||||
Set(ByVal value As Integer)
|
||||
_DimStandard = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property DimStandardMiniatura() As Integer
|
||||
Get
|
||||
Return _DimStandardMiniatura
|
||||
End Get
|
||||
Set(ByVal value As Integer)
|
||||
_DimStandardMiniatura = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property NomeData() As Boolean
|
||||
Get
|
||||
Return _NomeData
|
||||
End Get
|
||||
Set(ByVal value As Boolean)
|
||||
_NomeData = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property TestoNome() As Boolean
|
||||
Get
|
||||
Return _TestoNome
|
||||
End Get
|
||||
Set(ByVal value As Boolean)
|
||||
_TestoNome = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property UsaOrarioMiniatura() As Boolean
|
||||
Get
|
||||
Return _UsaOrarioMiniatura
|
||||
End Get
|
||||
Set(ByVal value As Boolean)
|
||||
_UsaOrarioMiniatura = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property UsaOrarioTestoApplicare() As Boolean
|
||||
Get
|
||||
Return _UsaOrarioTestoApplicare
|
||||
End Get
|
||||
Set(ByVal value As Boolean)
|
||||
_UsaOrarioTestoApplicare = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property UsaTempoGaraTestoApplicare() As Boolean
|
||||
Get
|
||||
Return _UsaTempoGaraTestoApplicare
|
||||
End Get
|
||||
Set(ByVal value As Boolean)
|
||||
_UsaTempoGaraTestoApplicare = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property UsaRotazioneAutomatica() As Boolean
|
||||
Get
|
||||
Return _UsaRotazioneAutomatica
|
||||
End Get
|
||||
Set(ByVal value As Boolean)
|
||||
_UsaRotazioneAutomatica = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property UsaForzaJpg() As Boolean
|
||||
Get
|
||||
Return _UsaForzaJpg
|
||||
End Get
|
||||
Set(ByVal value As Boolean)
|
||||
_UsaForzaJpg = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
|
||||
Public Property LarghezzaSmall() As Integer
|
||||
Get
|
||||
Return _LarghezzaSmall
|
||||
End Get
|
||||
Set(ByVal value As Integer)
|
||||
_LarghezzaSmall = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property AltezzaSmall() As Integer
|
||||
Get
|
||||
Return _AltezzaSmall
|
||||
End Get
|
||||
Set(ByVal value As Integer)
|
||||
_AltezzaSmall = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property CreaMiniature() As Boolean
|
||||
Get
|
||||
Return _CreaMiniature
|
||||
End Get
|
||||
Set(ByVal value As Boolean)
|
||||
_CreaMiniature = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property AggiungiScritteMiniature() As Boolean
|
||||
Get
|
||||
Return _AggiungiScritteMiniature
|
||||
End Get
|
||||
Set(ByVal value As Boolean)
|
||||
_AggiungiScritteMiniature = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property Suffisso() As String
|
||||
Get
|
||||
Return _Suffisso
|
||||
End Get
|
||||
Set(ByVal value As String)
|
||||
_Suffisso = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property Codice() As String
|
||||
Get
|
||||
Return _Codice
|
||||
End Get
|
||||
Set(ByVal value As String)
|
||||
_Codice = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property Trasparenza() As Integer
|
||||
Get
|
||||
Return _Trasparenza
|
||||
End Get
|
||||
Set(ByVal value As Integer)
|
||||
_Trasparenza = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property IlFont() As String
|
||||
Get
|
||||
Return _IlFont
|
||||
End Get
|
||||
Set(ByVal value As String)
|
||||
_IlFont = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property Grassetto() As Boolean
|
||||
Get
|
||||
Return _Grassetto
|
||||
End Get
|
||||
Set(ByVal value As Boolean)
|
||||
_Grassetto = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property Posizione() As String
|
||||
Get
|
||||
Return _Posizione
|
||||
End Get
|
||||
Set(ByVal value As String)
|
||||
_Posizione = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property Allineamento() As String
|
||||
Get
|
||||
Return _Allineamento
|
||||
End Get
|
||||
Set(ByVal value As String)
|
||||
_Allineamento = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property Margine() As Integer
|
||||
Get
|
||||
Return _Margine
|
||||
End Get
|
||||
Set(ByVal value As Integer)
|
||||
_Margine = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property LogoAltezza() As Integer
|
||||
Get
|
||||
Return _LogoAltezza
|
||||
End Get
|
||||
Set(ByVal value As Integer)
|
||||
_LogoAltezza = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property LogoLarghezza() As Integer
|
||||
Get
|
||||
Return _LogoLarghezza
|
||||
End Get
|
||||
Set(ByVal value As Integer)
|
||||
_LogoLarghezza = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property fontColoreRGB() As Color
|
||||
Get
|
||||
Return _fontColoreRGB
|
||||
End Get
|
||||
Set(ByVal value As Color)
|
||||
_fontColoreRGB = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property LogoAggiungi() As Boolean
|
||||
Get
|
||||
Return _LogoAggiungi
|
||||
End Get
|
||||
Set(ByVal value As Boolean)
|
||||
_LogoAggiungi = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property LogoNomeFile() As String
|
||||
Get
|
||||
Return _LogoNomeFile
|
||||
End Get
|
||||
Set(ByVal value As String)
|
||||
_LogoNomeFile = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property LogoTrasparenza() As String
|
||||
Get
|
||||
Return _LogoTrasparenza
|
||||
End Get
|
||||
Set(ByVal value As String)
|
||||
_LogoTrasparenza = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property LogoMargine() As String
|
||||
Get
|
||||
Return _LogoMargine
|
||||
End Get
|
||||
Set(ByVal value As String)
|
||||
_LogoMargine = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property LogoPosizioneH() As String
|
||||
Get
|
||||
Return _LogoPosizioneH
|
||||
End Get
|
||||
Set(ByVal value As String)
|
||||
_LogoPosizioneH = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property LogoPosizioneV() As String
|
||||
Get
|
||||
Return _LogoPosizioneV
|
||||
End Get
|
||||
Set(ByVal value As String)
|
||||
_LogoPosizioneV = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property FotoGrandeDimOrigina() As Boolean
|
||||
Get
|
||||
Return _FotoGrandeDimOrigina
|
||||
End Get
|
||||
Set(ByVal value As Boolean)
|
||||
_FotoGrandeDimOrigina = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property AltezzaBig() As Integer
|
||||
Get
|
||||
Return _AltezzaBig
|
||||
End Get
|
||||
Set(ByVal value As Integer)
|
||||
_AltezzaBig = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property LarghezzaBig() As Integer
|
||||
Get
|
||||
Return _LarghezzaBig
|
||||
End Get
|
||||
Set(ByVal value As Integer)
|
||||
_LarghezzaBig = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property DestDir() As DirectoryInfo
|
||||
Get
|
||||
Return _DestDir
|
||||
End Get
|
||||
Set(ByVal value As DirectoryInfo)
|
||||
_DestDir = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property DimVert() As Integer
|
||||
Get
|
||||
Return _DimVert
|
||||
|
||||
End Get
|
||||
Set(ByVal value As Integer)
|
||||
_DimVert = value
|
||||
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property MargVert() As Integer
|
||||
Get
|
||||
Return _MargVert
|
||||
|
||||
End Get
|
||||
Set(ByVal value As Integer)
|
||||
_MargVert = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property TestoMin() As Boolean
|
||||
Get
|
||||
Return _TestoMin
|
||||
|
||||
End Get
|
||||
Set(ByVal value As Boolean)
|
||||
_TestoMin = value
|
||||
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property DimMin() As Integer
|
||||
Get
|
||||
Return _DimMin
|
||||
|
||||
End Get
|
||||
Set(ByVal value As Integer)
|
||||
_DimMin = value
|
||||
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property SecretDefault() As Boolean
|
||||
Get
|
||||
Return _SecretDefault
|
||||
|
||||
End Get
|
||||
Set(ByVal value As Boolean)
|
||||
_SecretDefault = value
|
||||
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property SecretBig() As Boolean
|
||||
Get
|
||||
Return _SecretBig
|
||||
|
||||
End Get
|
||||
Set(ByVal value As Boolean)
|
||||
_SecretBig = value
|
||||
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property SecretSmall() As Boolean
|
||||
Get
|
||||
Return _SecretSmall
|
||||
|
||||
End Get
|
||||
Set(ByVal value As Boolean)
|
||||
_SecretSmall = value
|
||||
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property SecretPathSmall() As String
|
||||
Get
|
||||
Return _SecretPathSmall
|
||||
|
||||
End Get
|
||||
Set(ByVal value As String)
|
||||
_SecretPathSmall = value
|
||||
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property SecretPathBig() As String
|
||||
Get
|
||||
Return _SecretPathBig
|
||||
|
||||
End Get
|
||||
Set(ByVal value As String)
|
||||
_SecretPathBig = value
|
||||
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property AggTempoGaraMin() As Boolean
|
||||
Get
|
||||
Return _AggTempoGaraMin
|
||||
|
||||
End Get
|
||||
Set(ByVal value As Boolean)
|
||||
_AggTempoGaraMin = value
|
||||
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property AggNumTempMin() As Boolean
|
||||
Get
|
||||
Return _AggNumTempMin
|
||||
|
||||
End Get
|
||||
Set(ByVal value As Boolean)
|
||||
_AggNumTempMin = value
|
||||
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property jpegQuality() As Long
|
||||
Get
|
||||
Return _jpegQuality
|
||||
End Get
|
||||
Set(ByVal value As Long)
|
||||
_jpegQuality = value
|
||||
End Set
|
||||
|
||||
End Property
|
||||
|
||||
Public Property jpegQualityMin() As Long
|
||||
Get
|
||||
Return _jpegQualityMin
|
||||
End Get
|
||||
Set(ByVal value As Long)
|
||||
_jpegQualityMin = value
|
||||
End Set
|
||||
|
||||
End Property
|
||||
End Module
|
||||
185
imagecatalog/XYThreadPool.vb
Normal file
185
imagecatalog/XYThreadPool.vb
Normal file
|
|
@ -0,0 +1,185 @@
|
|||
Option Explicit On
|
||||
Option Strict On
|
||||
|
||||
Imports System.Threading
|
||||
Imports System.Collections
|
||||
|
||||
Public Delegate Sub ThreadErrorHandlerDelegate(ByVal oWorkItem As ThreadPoolWorkItem, ByVal oError As Exception)
|
||||
|
||||
Public Class ThreadPoolWorkItem
|
||||
Public m_bStoreOutput As Boolean = False
|
||||
Public m_sName As String = ""
|
||||
Public m_pMethod As [Delegate] = Nothing
|
||||
Public m_pInput As Object() = Nothing
|
||||
Public m_oOutput As Object = Nothing
|
||||
Public m_oException As Exception = Nothing
|
||||
Public Sub New()
|
||||
End Sub
|
||||
Public Sub New(ByVal sName As String, ByVal pMethod As [Delegate], ByVal pInput As Object(), ByVal bStoreOutput As Boolean)
|
||||
m_sName = sName
|
||||
m_pMethod = pMethod
|
||||
m_pInput = pInput
|
||||
m_bStoreOutput = bStoreOutput
|
||||
End Sub
|
||||
End Class
|
||||
|
||||
Public Class XYThreadPool
|
||||
Private m_htThreads As Hashtable = New Hashtable(256)
|
||||
Private m_nMinThreadCount As Integer = 5
|
||||
Private m_nMaxThreadCount As Integer = 10
|
||||
Private m_nShutdownPause As Integer = 200
|
||||
Private m_nServerPause As Integer = 25
|
||||
Private m_bContinue As Boolean = False
|
||||
Private m_oException As Exception = Nothing
|
||||
Private m_qInput As Queue = New Queue(1024)
|
||||
Private m_qOutput As Queue = New Queue(1024)
|
||||
Private m_delegateThreadErrorHandler As [Delegate] = New ThreadErrorHandlerDelegate(AddressOf OnThreadError)
|
||||
Private Sub ThreadProc()
|
||||
While m_bContinue
|
||||
Dim obj As Object = Nothing
|
||||
Monitor.Enter(Me)
|
||||
If m_qInput.Count > 0 Then obj = m_qInput.Dequeue()
|
||||
Monitor.Exit(Me)
|
||||
If obj Is Nothing Then
|
||||
Dim bQuit As Boolean = False
|
||||
Monitor.Enter(Me)
|
||||
If m_htThreads.Count > m_nMinThreadCount Then
|
||||
m_htThreads.Remove(Thread.CurrentThread.Name)
|
||||
bQuit = True
|
||||
End If
|
||||
Monitor.Exit(Me)
|
||||
If bQuit Then Return
|
||||
Thread.Sleep(10 * m_nServerPause)
|
||||
Else
|
||||
Dim oWorkItem As ThreadPoolWorkItem = CType(obj, ThreadPoolWorkItem)
|
||||
'oWorkItem.m_oOutput = oWorkItem.m_pMethod.DynamicInvoke(oWorkItem.m_pInput)
|
||||
Try
|
||||
oWorkItem.m_oOutput = oWorkItem.m_pMethod.DynamicInvoke(oWorkItem.m_pInput)
|
||||
Catch oBug As Exception
|
||||
If Not m_delegateThreadErrorHandler Is Nothing Then
|
||||
Try
|
||||
Dim pInput As Object() = {oWorkItem, oBug}
|
||||
m_delegateThreadErrorHandler.DynamicInvoke(pInput)
|
||||
Catch
|
||||
End Try
|
||||
End If
|
||||
End Try
|
||||
If oWorkItem.m_bStoreOutput Then
|
||||
Monitor.Enter(m_qOutput)
|
||||
m_qOutput.Enqueue(oWorkItem)
|
||||
Monitor.Exit(m_qOutput)
|
||||
End If
|
||||
Thread.Sleep(m_nServerPause)
|
||||
End If
|
||||
End While
|
||||
End Sub
|
||||
Private Sub OnThreadError(ByVal oWorkItem As ThreadPoolWorkItem, ByVal oError As Exception)
|
||||
If oWorkItem Is Nothing Then
|
||||
m_oException = oError
|
||||
Else
|
||||
oWorkItem.m_oException = oError
|
||||
End If
|
||||
End Sub
|
||||
Public Sub SetThreadErrorHandler(ByVal pMethod As ThreadErrorHandlerDelegate)
|
||||
Monitor.Enter(Me)
|
||||
m_delegateThreadErrorHandler = pMethod
|
||||
Monitor.Exit(Me)
|
||||
End Sub
|
||||
Public Sub SetServerPause(ByVal nMilliseconds As Integer)
|
||||
Monitor.Enter(Me)
|
||||
If nMilliseconds > 9 And nMilliseconds < 101 Then m_nServerPause = nMilliseconds
|
||||
Monitor.Exit(Me)
|
||||
End Sub
|
||||
Public Sub SetShutdownPause(ByVal nMilliseconds As Integer)
|
||||
Monitor.Enter(Me)
|
||||
m_nShutdownPause = nMilliseconds
|
||||
Monitor.Exit(Me)
|
||||
End Sub
|
||||
Public Function GetException() As Exception
|
||||
Return m_oException
|
||||
End Function
|
||||
Public Sub InsertWorkItem(ByVal oWorkItem As ThreadPoolWorkItem)
|
||||
Try
|
||||
Monitor.Enter(Me)
|
||||
m_qInput.Enqueue(oWorkItem)
|
||||
If m_bContinue AndAlso m_qInput.Count > m_htThreads.Count AndAlso m_htThreads.Count < m_nMaxThreadCount Then
|
||||
Dim th As Thread = New Thread(AddressOf ThreadProc)
|
||||
th.Name = Guid.NewGuid.ToString()
|
||||
m_htThreads.Add(th.Name, th)
|
||||
th.Start()
|
||||
End If
|
||||
Catch oBug As Exception
|
||||
m_oException = oBug
|
||||
Finally
|
||||
Monitor.Exit(Me)
|
||||
End Try
|
||||
End Sub
|
||||
Public Sub InsertWorkItem(ByVal sName As String, ByVal pMethod As [Delegate], ByVal pArgs As Object(), ByVal bStoreOutput As Boolean)
|
||||
InsertWorkItem(New ThreadPoolWorkItem(sName, pMethod, pArgs, bStoreOutput))
|
||||
End Sub
|
||||
Public Function ExtractWorkItem() As ThreadPoolWorkItem
|
||||
Dim oWorkItem As Object = Nothing
|
||||
Monitor.Enter(m_qOutput)
|
||||
If m_qOutput.Count > 0 Then oWorkItem = m_qOutput.Dequeue()
|
||||
Monitor.Exit(m_qOutput)
|
||||
If oWorkItem Is Nothing Then Return Nothing
|
||||
Return CType(oWorkItem, ThreadPoolWorkItem)
|
||||
End Function
|
||||
Public Function StartThreadPool(Optional ByVal nMinThreadCount As Integer = 5, Optional ByVal nMaxThreadCount As Integer = 10) As Boolean
|
||||
Try
|
||||
Monitor.Enter(Me)
|
||||
If m_bContinue = False Then
|
||||
m_bContinue = True
|
||||
If nMinThreadCount > 0 Then
|
||||
m_nMinThreadCount = nMinThreadCount
|
||||
End If
|
||||
If nMaxThreadCount > m_nMinThreadCount Then
|
||||
m_nMaxThreadCount = nMaxThreadCount
|
||||
Else
|
||||
m_nMaxThreadCount = 2 * m_nMinThreadCount
|
||||
End If
|
||||
Dim i As Integer
|
||||
For i = 1 To m_nMinThreadCount
|
||||
Dim th As Thread = New Thread(AddressOf ThreadProc)
|
||||
th.Name = Guid.NewGuid.ToString()
|
||||
m_htThreads.Add(th.Name, th)
|
||||
th.Start()
|
||||
Next i
|
||||
End If
|
||||
Return True
|
||||
Catch oBug As Exception
|
||||
m_bContinue = False
|
||||
m_oException = oBug
|
||||
Return False
|
||||
Finally
|
||||
Monitor.Exit(Me)
|
||||
End Try
|
||||
End Function
|
||||
Public Sub StopThreadPool()
|
||||
Monitor.Enter(Me)
|
||||
m_bContinue = False
|
||||
Thread.Sleep(Math.Max(200, m_nShutdownPause))
|
||||
If (m_nShutdownPause > 0) Then
|
||||
Dim dict As IDictionaryEnumerator = m_htThreads.GetEnumerator()
|
||||
While dict.MoveNext()
|
||||
Dim th As Thread = CType(dict.Value(), Thread)
|
||||
If th.IsAlive Then
|
||||
Try
|
||||
th.Abort()
|
||||
Catch
|
||||
End Try
|
||||
End If
|
||||
End While
|
||||
End If
|
||||
m_htThreads.Clear()
|
||||
m_qInput.Clear()
|
||||
' m_qOutput.Clear()
|
||||
Monitor.Exit(Me)
|
||||
End Sub
|
||||
Public Function GetThreadCount() As Integer
|
||||
Monitor.Enter(Me)
|
||||
Dim nCount As Integer = m_htThreads.Count
|
||||
Monitor.Exit(Me)
|
||||
Return nCount
|
||||
End Function
|
||||
End Class
|
||||
23
imagecatalog/app.config
Normal file
23
imagecatalog/app.config
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
<?xml version="1.0"?>
|
||||
<configuration>
|
||||
<system.diagnostics>
|
||||
<sources>
|
||||
<!-- Questa sezione definisce la configurazione di registrazione per My.Application.Log -->
|
||||
<source name="DefaultSource" switchName="DefaultSwitch">
|
||||
<listeners>
|
||||
<add name="FileLog"/>
|
||||
<!-- Per scrivere nel log eventi dell'applicazione, rimuovere il commento dalla sezione sottostante -->
|
||||
<!--<add name="EventLog"/>-->
|
||||
</listeners>
|
||||
</source>
|
||||
</sources>
|
||||
<switches>
|
||||
<add name="DefaultSwitch" value="Information"/>
|
||||
</switches>
|
||||
<sharedListeners>
|
||||
<add name="FileLog" type="Microsoft.VisualBasic.Logging.FileLogTraceListener, Microsoft.VisualBasic, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" initializeData="FileLogWriter"/>
|
||||
<!-- Per scrivere nel log eventi dell'applicazione, rimuovere il commento dalla sezione sottostante e sostituire APPLICATION_NAME con il nome dell'applicazione -->
|
||||
<!--<add name="EventLog" type="System.Diagnostics.EventLogTraceListener" initializeData="APPLICATION_NAME"/> -->
|
||||
</sharedListeners>
|
||||
</system.diagnostics>
|
||||
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0,Profile=Client"/></startup></configuration>
|
||||
Loading…
Add table
Add a link
Reference in a new issue