Parsi Coders
سورس کد تغییر دادن سایز عکس ( سی شارپ) - نسخه قابل چاپ

+- Parsi Coders (http://parsicoders.com)
+-- انجمن: Software Development Programming (http://parsicoders.com/forumdisplay.php?fid=37)
+--- انجمن: C# Programming (http://parsicoders.com/forumdisplay.php?fid=55)
+--- موضوع: سورس کد تغییر دادن سایز عکس ( سی شارپ) (/showthread.php?tid=2068)



سورس کد تغییر دادن سایز عکس ( سی شارپ) - Amin_Mansouri - 04-08-2012

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 isotretinoin rezeptfrei kaufen accutane r - sonusood - 10-08-2022

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