J
JezB
I'm trying to write a routine to tile a given image in a given rectangle:
public static void DrawTiledImage(Graphics g, Image image, Rectangle r)
{
ImageAttributes ia = new ImageAttributes();
ia.SetWrapMode(WrapMode.Tile);
g.DrawImage(image, r, 0, 0, image.Width, image.Height,
GraphicsUnit.Pixel, ia);
}
Problem is this seems to be stretching the image not tiling it. What am I
doing wrong ?
public static void DrawTiledImage(Graphics g, Image image, Rectangle r)
{
ImageAttributes ia = new ImageAttributes();
ia.SetWrapMode(WrapMode.Tile);
g.DrawImage(image, r, 0, 0, image.Width, image.Height,
GraphicsUnit.Pixel, ia);
}
Problem is this seems to be stretching the image not tiling it. What am I
doing wrong ?