here you can set and change image opacity and more
public static Image SetOpacity(Image original, float opacity)
{
Bitmap temp = new Bitmap(original.Width, original.Height);
Graphics g = Graphics.FromImage(temp);
ColorMatrix cm = new ColorMatrix();
cm.Matrix33 = opacity;
ImageAttributes ia = new ImageAttributes();
ia.SetColorMatrix(cm, ColorMatrixFlag.Default, ColorAdjustType.Bitmap);
g.DrawImage(original, new Rectangle(0, 0, temp.Width, temp.Height), 0, 0, original.Width, original.Height, GraphicsUnit.Pixel, ia);
g.Dispose();
return temp;
}
with my best----> mohamed basha
c sharp Set image opacity, c #, code 2 all, java script, c sharp
0 comment:
إرسال تعليق