Hey,
What image formats can we set the transparency on?
I found another support article that showed me how to do it for a png image (see below), but I’m looking for a full list of file formats and the documentation to show me how to do it?
Adding image with setting it’s opacity - Free Support Forum - aspose.com
using (PngImage pngImage = new PngImage(1500, 1500, PngColorType.TruecolorWithAlpha))
{
ColorMatrix cmxPic = new ColorMatrix();
cmxPic.Matrix33 = 0.6f;
ImageAttributes iaPic = new ImageAttributes();
iaPic.SetColorMatrix(cmxPic, ColorMatrixFlag.Default, ColorAdjustType.Bitmap);
using (Image loaded = Image.Load(“d:/temp/logo.png”))
{
Graphics gr = new Graphics(pngImage);
gr.DrawImage(loaded, loaded.Bounds, GraphicsUnit.Pixel, iaPic);
}
pngImage.Save(“D:/newPng.png”);
}
Kind regards,
Dan