Ghost-borders ('ringing') when resizing in GDI+

后端 未结 2 718
北荒
北荒 2020-11-29 05:15

What happens (only noticeable on certain images) is I will see a 1 pixel white border that is inset one pixel. It seems to happen in areas that are light but not white (e.g.

2条回答
  •  悲&欢浪女
    2020-11-29 06:10

    Try:

    g.CompositingMode = CompositingMode.SourceCopy;
    

    From my answer here, corrected for syntax.

    The resizing is creating partial transparency around the border. Setting SourceCopy tells it to replace that partially transparent pixel with a fully opaque one.

提交回复
热议问题