DrawNineSlice

Category: Images and Rendering

Back to System Functions


Signature

DrawNineSlice(imageReference As Integer, x As Integer, y As Integer, width As Integer, height As Integer, marginRight As Integer, marginBottom As Integer, marginLeft As Integer, marginTop As Integer) DrawNineSlice(imageReference As Integer, x As Integer, y As Integer, width As Integer, height As Integer, marginRight As Integer, marginBottom As Integer, marginLeft As Integer, marginTop As Integer, repeat As Boolean)

Returns

Void

Description

Queues a nine-slice image using the entire source image and the supplied border margins.

The x and y position mark the image hotspot. Use SetImageHotspot to move that origin.

The margins are measured in source-image pixels and define the right, bottom, left, and top border pieces. The center region is the content area between those margins.

When repeat is True, the stretchable edge and center sections are tiled. When repeat is omitted or False, those sections are stretched instead.

Example

Graphics 640, 480 Dim panelRef As Integer panelRef = LoadImage("panel.png") DrawNineSlice(panelRef, 80, 60, 320, 180, 12, 12, 12, 12) DrawNineSlice(panelRef, 80, 260, 320, 120, 12, 12, 12, 12, True)