By default, the Viewport for TileBrush is 0,0,1,1, and ViewportUnits is RelativeToBoundingBox, which means that 0,0,1,1 displays the entire size of the destination (in this case, the borders of the grid).
So, if you want to focus ImageBrush, you will need to configure Viewport. If you must set Viewport to 0,0, .5, .5, you should see 2 x 2 tiles (since each tile will be 50% x50% of the grid size) or 0,0,0,25, 0.1 will produce 4x10 tiles, etc.
However, this still does not prevent image scaling. Thus, in your case, what you probably want is to set the viewport size to the size of your image and set ViewportUnits to Absolute instead of RelativeToBoundingBox.
In xaml below, I have a 24x24 pixel image, so I set my viewport accordingly. This will fragment the image again for the full size of the grid. If the grid is changed, more fragments will appear.
<ImageBrush ImageSource="Images\book_green.png" TileMode="FlipX" Viewport="0,0,24,24" ViewportUnits="Absolute" />
I hope this helps.
Liz
source share