4.4 NineGrid Examples
The following diagram illustrates how a NineGrid bitmap may be resized when it is rendered. The NineGrid Bitmap Information (section 184.108.40.206.220.127.116.11) structure defines the grid layout, specifically the sizes of the LeftWidth, RightWidth, TopHeight, and BottomHeight constants.
Figure 18: Expansion of a NineGrid bitmap
The following diagram illustrates how a source bitmap in the NineGrid Bitmap Cache (section 18.104.22.168.6) is clipped and then modified using a NineGrid transformation to produce a final image in a destination rectangle.
Figure 19: Illustration of Draw Nine Grid Primary Drawing Order
The DrawNineGrid (section 22.214.171.124.126.96.36.199) and MultiDrawNineGrid (section 188.8.131.52.184.108.40.206) Primary Drawing Orders are used to render NineGrid bitmaps that have been stored in the NineGrid Bitmap Cache using the Create NineGrid Bitmap (section 220.127.116.11.1.3.4) and Stream Bitmap Orders (section 18.104.22.168.1.3.5).