4.4 NineGrid Examples
The following diagram illustrates how a NineGrid bitmap can be resized when it is rendered. The NineGrid Bitmap Information (section 126.96.36.199.188.8.131.52) 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 184.108.40.206.6) is clipped and then modified using a NineGrid transformation to produce a final image in a destination rectangle.
Figure 19: Illustration of Draw NineGrid Primary Drawing Order
The DrawNineGrid (section 220.127.116.11.18.104.22.168) and MultiDrawNineGrid (section 22.214.171.124.126.96.36.199) Primary Drawing Orders are used to render NineGrid bitmaps that have been stored in the NineGrid Bitmap Cache using the Create NineGrid Bitmap (section 188.8.131.52.1.3.4) and Stream Bitmap Orders (section 184.108.40.206.1.3.5).