VintaSoft PDF .NET Plug-in Discussions
Questions, comments and suggestions concerning VintaSoft PDF .NET Plug-in.
Board index < VintaSoft Imaging < VintaSoft PDF .NET Plug-in Discussions
using (VintasoftImage image = imageResource.GetImage())
{
В В byte alpha = (byte)Math.Round(newOpacity * 255);
В В // if annotation does NOT have transparency
В В if (alpha == 255)
В В {
В В В В В // remove the alpha channel
В В В В В Vintasoft.Imaging.ImageProcessing.ChangePixelFormatCommand toBgr24 = new Vintasoft.Imaging.ImageProcessing.ChangePixelFormatCommand(PixelFormat.Bgr24);
В В В В В toBgr24.ExecuteInPlace(image);
В В }
В В // if annotation has transparency
В В else
В В {
В В В В В // set the alpha channel value
В В В В В Vintasoft.Imaging.ImageProcessing.Color.SetAlphaChannelValueCommand setAlpha = new Vintasoft.Imaging.ImageProcessing.Color.SetAlphaChannelValueCommand(alpha);
В В В В В setAlpha.ExecuteInPlace(image);
В В }
В В imageResource.SetImage(image, imageResource.Compression, new PdfCompressionSettings());
}
Best regards, Alexander