Using Graphics.DrawImage() to Draw Image with Transparency/Alpha Channel

后端 未结 2 1388
心在旅途
心在旅途 2020-11-29 08:48

I\'m copying an image. (My actual code is resizing the image but that\'s not relevant to my question.) My code looks something like this.

Image src = ...

us         


        
2条回答
  •  温柔的废话
    2020-11-29 08:56

    I found this thread because I had the same problem (i.e. DrawImage didn't copy the alpha channel), but in my case it was simply because I overlooked that I used PixelFormat.Format32bppRgb instead of PixelFormat.Format32bppArgb. So pretty much what Lukasz M said in the comments.

提交回复
热议问题