Quick Start v1.0.0

Last updated: April 19th, 2017

Download

This Library Help you to resize Image
(FixedSize - ScaleImage - ARGB - ScaleByPercent - Crop)

ImageResizer

Installation

run the following command in the Package Manager Console

PM> Install-Package Amr.ImageResizer

Code

Fixed Size

Amr.Resizer.FixedSize(string image_source, int width, int height, string background , string opecity)

string opecity :

100% - FF 95% - F2 90% - E6 85% - D9 80% - CC 75% - BF
70% - B3 65% - A6 60% - 99 55% - 8C 50% - 80 45% - 73
40% - 66 35% - 59 30% - 4D 25% - 40 20% - 33 15% - 26
10% - 1A 5% - 0D 0% - 00
C# Code Example

                                        
             using (var newImage = Amr.Resizer.FixedSize(image_source, 250, 250, "#FE2E2E"))
            {
                newImage.Save(WorkingDirectory + "FixedSize.jpg", ImageFormat.Jpeg);

                newImage.Dispose();
            }
                                        

Scale By Percent

Amr.Resizer.ScaleByPercent(string image_source, int Percent)

C# Code Example

                                        
             using (var newImage = Amr.Resizer.ScaleByPercent(image_source, 50))
            {
                newImage.Save(WorkingDirectory + "ScaleByPercent.jpg", ImageFormat.Jpeg);

                newImage.Dispose();
            }
                                        

Scale Image

Amr.Resizer.ScaleImage(string image_source, int width, int height)

C# Code Example

                                        
             using (var newImage = Amr.Resizer.ScaleImage(image_source, 300, 400))
            {
                newImage.Save(WorkingDirectory + "ScaleImage.jpg", ImageFormat.Jpeg);

                newImage.Dispose();
            }
                                        

Crop Image

Amr.Resizer.Crop(string image_source, int width, int height, string Anchor)

string Anchor :

- Top
- Bottom
- Left
- Right
- default (middel)
C# Code Example

                                        
             using (var newImage = Amr.Resizer.Crop(image_source, 250, 250, "Top"))
            {
                newImage.Save(WorkingDirectory + "Crop.jpg", ImageFormat.Jpeg);

                newImage.Dispose();
            }