خرید بک لینک

سلام دوست من اول یه متد داخل کلاس Form بساز به این شکل


public static Bitmap ChangeOpacity(Image image, float opacityvalue)
{
Bitmap Bitmap1 = new Bitmap(image.Width, image.Height);
Graphics graphics = Graphics.FromImage(Bitmap1);
ColorMatrix colormatrix = new ColorMatrix();
colormatrix.Matrix33 = opacityvalue;
ImageAttributes ImageAttribute = new ImageAttributes();
ImageAttribute.SetColorMatrix(colormatrix, ColorMatrixFlag.Default, ColorAdjustType.Bitmap);
graphics.DrawImage(image, new Rectangle(0, 0, Bitmap1.Width, Bitmap1.Height), 0, 0, image.Width, image.Height, GraphicsUnit.Pixel, ImageAttribute);
graphics.Dispose();
retu Bitmap1;
}

بعد داخل کنترل مورد نظرت (به عنوان مثال Form_Load) اینو بنویس


pictureBox1.Image = ChangeOpacity(Image.FromFile(@"آدرس عکس.jpg"), (0.5f));

پیروز و موفق باشی .
از کدنویسی لذت ببری

- - , .
.

برچسب: نویسنده: محمد رضا جوادیان تاريخ: شنبه 26 تير 1395 ساعت: 22:11

صفحه بندی