当前位置:首页 > Windows程序 > 正文

C# 解决DrawImage绘制图片拉伸产生渐变

2021-03-11 Windows程序

ImageAttributes ImgAtt = new ImageAttributes(); ;
                ImgAtt.SetWrapMode(System.Drawing.Drawing2D.WrapMode.TileFlipXY);

m_graphics.DrawImage(image, new System.Drawing.Rectangle((int)(x - width / 2 + backBmp1.Width), (int)(y - pixel + 1), backBmp2.Width, backBmp2.Height), 0, 0, backImage2.Width, backImage2.Height, GraphicsUnit.Pixel,ImgAtt);

TextureBrush Txbrus = new TextureBrush(image);
 Txbrus.WrapMode = System.Drawing.Drawing2D.WrapMode.Tile;
 g.FillRectangle(Txbrus, new Rectangle(0, 0, width, height));

温馨提示: 本文由Jm博客推荐,转载请保留链接: https://www.jmwww.net/file/59387.html