wyrd
Well-known member
I read that the TextureBrush is faster to draw images then a Bitmap, so I gave it a shot. It seems to crank out an extra 5 fps, but unfortunately I cant get it to work correctly. I have it set up like this;
TextureBrush brush = new TextureBrush(image, imageRect);
To draw the brush..
graphics.FillRectangle(brush, location.x, location.y, brush.width, brush.height);
I hope thats pretty self explanatory. The actual code is on another machine so I apologize.
Anyway.. when drawing the brush (graphics.FillRectangle()) in different locations (moving the x and y location coordinates) it seems to "wrap" the image.
I tried changing the WrapMode to WrapMode.Clamp, unfortunately it treated the image as if it was always located at coordinates 0, 0 and if I filled a rectangle away from those coordinates (ie; 100, 100) it wouldnt display anything.
Anyone have any idea what Im doing wrong?
TextureBrush brush = new TextureBrush(image, imageRect);
To draw the brush..
graphics.FillRectangle(brush, location.x, location.y, brush.width, brush.height);
I hope thats pretty self explanatory. The actual code is on another machine so I apologize.
Anyway.. when drawing the brush (graphics.FillRectangle()) in different locations (moving the x and y location coordinates) it seems to "wrap" the image.
I tried changing the WrapMode to WrapMode.Clamp, unfortunately it treated the image as if it was always located at coordinates 0, 0 and if I filled a rectangle away from those coordinates (ie; 100, 100) it wouldnt display anything.
Anyone have any idea what Im doing wrong?