Moved to x64
This commit is contained in:
parent
7c1633261c
commit
71af9e7eeb
13 changed files with 308 additions and 39 deletions
|
|
@ -1,18 +1,29 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Drawing;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Numerics;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using ImageSharp;
|
||||
using SixLabors.Fonts;
|
||||
using Color = ImageSharp.Color;
|
||||
using Font = SixLabors.Fonts.Font;
|
||||
using FontFamily = SixLabors.Fonts.FontFamily;
|
||||
using FontStyle = SixLabors.Fonts.FontStyle;
|
||||
using Image = ImageSharp.Image;
|
||||
|
||||
|
||||
namespace CatalogLib
|
||||
{
|
||||
public class ImgSharpCreator : IImageProcessor
|
||||
{
|
||||
private FileInfo _currentFile;
|
||||
public void Start(FileInfo workFile)
|
||||
{
|
||||
_currentFile = workFile;
|
||||
using (Image image = new Image(workFile.FullName))
|
||||
{
|
||||
if (PicSettings.Instance.UsaRotazioneAutomatica)
|
||||
|
|
@ -68,16 +79,39 @@ namespace CatalogLib
|
|||
|
||||
}
|
||||
|
||||
SetExtraText(image);
|
||||
|
||||
//JpegDecoder j = new JpegDecoder();
|
||||
var va = Vector.IsHardwareAccelerated;
|
||||
|
||||
image.Resize(PicSettings.Instance.FotoLarghezza, PicSettings.Instance.FotoAltezza);
|
||||
//image.Resize(2240, 2240);
|
||||
//var fff = FontCollection.SystemFonts.Find(PicSettings.Instance.NomeFont);
|
||||
//var font = new Font(fff, (float)PicSettings.Instance.DimensioneFont, FontStyle.Regular);
|
||||
//image.DrawText("sssssssssssssssssssssssssssssssssssssssssssssss", font, Color.Black, new Vector2(200, 200));
|
||||
image.Save(Path.Combine(PicSettings.Instance.DirectoryDestinazione, workFile.Name));
|
||||
//image.Resize(200, 200).Save("");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void SetExtraText(ref Image image)
|
||||
private void SetExtraText(Image image)
|
||||
{
|
||||
//if ()
|
||||
if (string.IsNullOrWhiteSpace(PicSettings.Instance.TestoApplicareOrizzontale))
|
||||
{
|
||||
Debug.WriteLine($"{_currentFile.Name} No text");
|
||||
return;
|
||||
}
|
||||
var fff = FontCollection.SystemFonts.Find(PicSettings.Instance.NomeFont);
|
||||
//var fff = FontCollection.SystemFonts.Find("Segoe Print");
|
||||
|
||||
var font = new Font(fff, (float) PicSettings.Instance.DimensioneFont, FontStyle.Regular);
|
||||
//var font = new Font(fff, 8f, FontStyle.Regular);
|
||||
|
||||
|
||||
image.DrawText(PicSettings.Instance.TestoApplicareOrizzontale, font, Color.Black, new Vector2(200, 200));
|
||||
//image.DrawText("sssssssssssssssssssssssssssssssssssssssssssssss", font, Color.Black, new Vector2(200, 200));
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue