-
Notifications
You must be signed in to change notification settings - Fork 0
rasouliali/ImageResize
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
This project is Image Resizer for Linux machins. This project is used from SkiaSharp library and SkiaSharp.NativeAssets.Linux library. public static void ResizeImage(Stream fileContents, int maxWidth, int maxHeight, string saveFilePath, SKFilterQuality quality = SKFilterQuality.Medium) { fileContents.Seek(0, SeekOrigin.Begin); using SKBitmap sourceBitmap = SKBitmap.Decode(fileContents); using SKBitmap scaledBitmap = sourceBitmap.Resize(new SKImageInfo(maxWidth, maxHeight), quality); using SKImage scaledImage = SKImage.FromBitmap(scaledBitmap); using SKData data = scaledImage.Encode(); using (var fileStream = System.IO.File.Create(saveFilePath)) { var myStream = data.AsStream(); myStream.Seek(0, SeekOrigin.Begin); myStream.CopyTo(fileStream); } }
About
ImageResize Work on Ubuntu server
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published