Please comment below...
- C# 7.0 – Pattern Matching by Christian Nagel.
- How to create a dotnet new project template in .NET Core by Chad Ramos.
Please comment below...
[Benchmark(Description = "ImageSharp Resize")] | |
public ImageSharpSize ResizeImageSharp() | |
{ | |
ImageSharpImage image = new ImageSharpImage(Width, Height); | |
image.Resize(ResizedWidth, ResizedHeight); | |
return new ImageSharpSize(ResizedWidth, ResizedHeight); | |
} |
Please comment below...
Package of the week: Readline
Please comment below...
private void OnGGAEvent(object sender, GPS.GPSGGA GGA) | |
{ | |
if (GGA.Quality != GPS.GPSGGA.FixQuality.noFix) | |
{ | |
AltitudeTextBox.Text = GGA.Altitude.ToString(); | |
LatitudeTextBox.Text = GGA.LatDegrees.ToString(); | |
LogitudeTextBox.Text = GGA.LonDegrees.ToString(); | |
} | |
} |
Please comment below...
Tool of the week: CrazyCore
using FreeImageAPI; | |
const int size = 150; | |
using (var original = FreeImageBitmap.FromFile(path)) | |
{ | |
int width, height; | |
if (original.Width > original.Height) | |
{ | |
width = size; |
using SkiaSharp; | |
const int size = 150; | |
const int quality = 75; | |
using (var input = File.OpenRead(inputPath)) | |
{ | |
using (var inputStream = new SKManagedStream(input)) | |
{ | |
using (var original = SKBitmap.Decode(inputStream)) |
using ImageMagick; | |
const int size = 150; | |
const int quality = 75; | |
using (var image = new MagickImage(inputPath)) | |
{ | |
image.Resize(size, size); | |
image.Strip(); | |
image.Quality = quality; |
var exif = image.ExifProfile; | |
var description = exif.GetValue(ImageSharpExifTag.ImageDescription); | |
var yearTaken = DateTime.ParseExact( | |
(string)exif.GetValue(ImageSharpExifTag.DateTimeOriginal).Value, | |
"yyyy:MM:dd HH:mm:ss", | |
CultureInfo.InvariantCulture) | |
.Year; | |
var author = exif.GetValue(ImageSharpExifTag.Artist); | |
var copyright = $"{description} (c) {yearTaken} {author}"; | |
exif.SetValue(ImageSharpExifTag.Copyright, copyright); |