PDA

View Full Version : چرخاندن عکس در Picture Box



MehdiLiver
یک شنبه 02 اسفند 1388, 17:17 عصر
با سلام چطور میتونم عکسم رو بچرخونم تو Picture Box???

r00tkit
یک شنبه 02 اسفند 1388, 17:35 عصر
pictureBox1.Image.RotateFlip(RotateFlipType.Rotate 270FlipX);
pictureBox1.Invalidate();

r00tkit
یک شنبه 02 اسفند 1388, 17:37 عصر
public static Image RotateImage(Image img, float rotationAngle)

{

//create an empty Bitmap image

Bitmap bmp = new Bitmap(img.Width, img.Height);

//turn the Bitmap into a Graphics object

Graphics gfx = Graphics.FromImage(bmp);



//now we set the rotation point to the center of our image

gfx.TranslateTransform((float)bmp.Width / 2, (float)bmp.Height / 2);



//now rotate the image

gfx.RotateTransform(rotationAngle);



gfx.TranslateTransform(-(float)bmp.Width / 2, -(float)bmp.Height / 2);



//set the InterpolationMode to HighQualityBicubic so to ensure a high

//quality image once it is transformed to the specified size

gfx.InterpolationMode = InterpolationMode.HighQualityBicubic;



//now draw our new image onto the graphics object

gfx.DrawImage(img, new Point(0, 0));



//dispose of our Graphics object

gfx.Dispose();



//return the image

return bmp;

}

MehdiLiver
یک شنبه 02 اسفند 1388, 17:45 عصر
مرسی ، فرمان Zoom کردن هم میدونی ؟
ممنون

r00tkit
یک شنبه 02 اسفند 1388, 19:42 عصر
سلام ) خودتم کمی سرچ کن

http://www.codeproject.com/KB/graphics/PictureBoxZoom.aspx

Netsky
یک شنبه 02 اسفند 1388, 21:14 عصر
سلام .
اینم یه سورس کد کامل واسه چرخوندن عکسها و البته قابلیت ذخیره سازی عکس چرخونده شده .
لینک (http://barnamenevis.org/forum/showpost.php?p=887356&postcount=408)