private static Crop ( Image image, int newWidth, int newHeight ) : Image | ||
image | Image | |
newWidth | int | |
newHeight | int | |
Résultat | Image |
private static Image Crop(Image image, int newWidth, int newHeight)
{
int x = 0;
if (image.Width > newWidth)
{
int excessWidth = image.Width - newWidth;
x = excessWidth / 2;
}
return image.Crop(newWidth, newHeight, x);
}
}