The prototype of StretchableImage is as follows:
Public virtual UIImage StretchableImage (int leftCapWidth, int topCapHeight) {UIImage result; using (new NSAID utoreleasepool () {if (this. isDirectBinding) {result = (UIImage) Runtime. getNSObject (Messaging. intPtr_objc_msgSend_int_int (base. handle, Selector. getHandle ("stretchableImageWithLeftCapWidth: topCapHeight:"), leftCapWidth, topCapHeight);} else {result = (UIImage) Runtime. getNSObject (Messaging. intPtr_objc_msgSendSuper_int_int (base. superHandle, Selector. getHandle ("stretchableImageWithLeftCapWidth: topCapHeight:"), leftCapWidth, topCapHeight) ;}} return result ;}
It refers to the horizontal and vertical extension of the target image, similar to the tile (repeat-x, repeat-y) In css. But note that it requires two parameters to work together, and they are divided into block objects, which are the adjacent block objects on the right and bottom of the two parameter values. If 10 or 5 are specified. Then, 10 pixels on the left and 5 pixels on the top of the image. It will not be stretched. If the x coordinate is 11 and a pixel is copied horizontally, a pixel with the y coordinate is copied vertically. Note: Only copy a pixel to a certain width.