Parsi Coders

نسخه‌ی کامل: سورس کد تغییر دادن سایز عکس ( سی شارپ)
شما در حال مشاهده نسخه آرشیو هستید. برای مشاهده نسخه کامل کلیک کنید.
Need references to System.Drawing, System.Drawing.Drawing2D, System.Drawing.Imaging Namespaces


نقل قول://Namespace Reference
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Drawing.Imaging;

/// <summary>
/// method for resizing an image
/// </summary>
/// <param name="img">the image to resize</param>
/// <param name="percentage">Percentage of change (i.e for 105% of the original provide 105)</param>
/// <returns></returns>
public Image Resize(Image img, int percentage)
{
//get the height and width of the image
int originalW = img.Width;
int originalH = img.Height;

//get the new size based on the percentage change
int resizedW = (int)(originalW * percentage);
int resizedH = (int)(originalH * percentage);

//create a new Bitmap the size of the new image
Bitmap bmp = new Bitmap(resizedW, resizedH);
//create a new graphic from the Bitmap
Graphics graphic = Graphics.FromImage((Image)bmp);
graphic.InterpolationMode = InterpolationMode.HighQualityBicubic;
//draw the newly resized image
graphic.DrawImage(img, 0, 0, resizedW, resizedH);
//dispose and free up the resources
graphic.Dispose();
//return the image
return (Image)bmp;
}
isotretinoin tabletten rezeptfrei accutane rezeptfrei bestellen accutane tabletten kaufen
isotretinoin rezeptfrei kaufen accutane rezeptfrei bestellen accutane rezeptfrei bestellen
accutane rezeptfrei accutane rezeptfrei bestellen accutane kaufen schweiz
accutane kaufen ohne rezept accutane rezeptfrei bestellen accutane isotretinoin kaufen
accutane ohne rezept accutane tabletten kaufen isotretinoin ohne rezept kaufen
accutane kaufen accutane rezeptfrei bestellen accutane online kaufen