I have a problem with image scaling in .NET. I use the standard Graphics type to resize images like in this example:
public static Image Scale(Image sourceIm
The real solution is to use an overload of the DrawImage
which allows you to pass a ImageAttributes
object.
On the ImageAttributes
instance, call the following method before passing it to DrawImage
:
using (var ia = new ImageAttributes())
{
ia.SetWrapMode(WrapMode.TileFlipXY);
aGraphic.DrawImage(..., ia);
}
See also this answer