开发者

C# Console App System.Drawing Background Transparency Question

开发者 https://www.devze.com 2022-12-09 21:02 出处:网络
Should be a quick and easy question. Does Sy开发者_如何学Gostem.Drawing.Graphics.DrawImage() or Image.Save() by default make an image background transparent?I had to use System.Drawing.Bitmap to adju

Should be a quick and easy question.

Does Sy开发者_如何学Gostem.Drawing.Graphics.DrawImage() or Image.Save() by default make an image background transparent? I had to use System.Drawing.Bitmap to adjust image resolutions and now all of the converted images have a transparent background.

Futher details: We are using ImageMagick to do the basic image conversion from .eps to .jpg, but we can't seem to nail down the resolution conversion in ImageMagick so we decided to use System.Drawing to handle that portion. We are also setting InterpolationMode to HighQualityBicubic.

Please let me know if you need any other details!

Thanks in advance!

  • Jesse


If you create a new (empty) Format32bppArgb Bitmap it will, by default, be fully transparent.

Neither DrawImage nor Save have anything to do with making it transparent. But they will respect existing transparencies (if the Pixelformat supports transparencies).

If you are using ImageAttributes you might have made a mistake there (which could create transparency when using e.g. DrawImage).

0

精彩评论

暂无评论...
验证码 换一张
取 消