Resize PNG image without losing color data from fully transparent pixels
问题 I've been trying to figure out a way to resize a PNG image without losing color data from pixels that are completely transparent. Here is the code that I'm using to achieve this: //sourceImage is also a bitmap read in earlier using (var scaledBitmap = new Bitmap(desiredWidth, desiredHeight, PixelFormat.Format32bppArgb)){ using (var g = Graphics.FromImage(scaledBitmap)){ var attr = new ImageAttributes(); attr.SetWrapMode(WrapMode.TileFlipXY); g.CompositingQuality = CompositingQuality