Skip to content

FillPattern

Identifies how the colour table held by a Fill is applied across the area being painted. The same colour stops produce very different results depending on the pattern --- a north-to-south gradient with two stops paints a top-to-bottom transition, while a corner gradient with the same stops paints from one corner outward. Used by Fill.Pattern.

ConstantValueDescription
tbPatternNone0No fill --- leaves the region transparent.
tbGradientNorthToSouth1Linear gradient from the top edge down to the bottom edge.
tbGradientSouthToNorth2Linear gradient from the bottom edge up to the top edge.
tbGradientWestToEast3Linear gradient from the left edge across to the right edge.
tbGradientEastToWest4Linear gradient from the right edge across to the left edge.
tbGradientNorthWestToSouthEast5Linear diagonal gradient from the top-left corner to the bottom-right.
tbGradientNorthWestToSouthEastAlt6Alternate diagonal: same axis as tbGradientNorthWestToSouthEast but with the stops mirrored about the centre.
tbGradientNorthEastToSouthWest7Linear diagonal gradient from the top-right corner to the bottom-left.
tbGradientNorthEastToSouthWestAlt8Alternate diagonal: same axis as tbGradientNorthEastToSouthWest but mirrored.
tbGradientSouthWestToNorthEast9Linear diagonal gradient from the bottom-left corner to the top-right.
tbGradientSouthWestToNorthEastAlt10Alternate diagonal: same axis as tbGradientSouthWestToNorthEast but mirrored.
tbGradientSouthEastToNorthWest11Linear diagonal gradient from the bottom-right corner to the top-left.
tbGradientSouthEastToNorthWestAlt12Alternate diagonal: same axis as tbGradientSouthEastToNorthWest but mirrored.
tbGradientCornerTopLeft13Radial-style gradient emanating from the top-left corner outward.
tbGradientCornerTopRight14Radial-style gradient emanating from the top-right corner outward.
tbGradientCornerBottomLeft15Radial-style gradient emanating from the bottom-left corner outward.
tbGradientCornerBottomRight16Radial-style gradient emanating from the bottom-right corner outward.
tbGradientCornerTopLeftAlt17Alternate top-left corner gradient with the stops mirrored.
tbGradientCornerTopRightAlt18Alternate top-right corner gradient with the stops mirrored.
tbGradientCornerBottomLeftAlt19Alternate bottom-left corner gradient with the stops mirrored.
tbGradientCornerBottomRightAlt20Alternate bottom-right corner gradient with the stops mirrored.

The colour table itself comes from the array of FillColorPoint values inside Fill.ColorPoints, interpolated to the configured Granularity.

The same two-stop pair painted with three different patterns produces three quite different results:

vb
' Top fades to bottom
pnlOne.BackgroundFill.SetSimplePattern vbWhite, &H99CCFF, _
        Pattern:=tbGradientNorthToSouth

' Left fades to right
pnlTwo.BackgroundFill.SetSimplePattern vbWhite, &H99CCFF, _
        Pattern:=tbGradientWestToEast

' Emanates from the top-left corner
pnlThree.BackgroundFill.SetSimplePattern vbWhite, &H99CCFF, _
        Pattern:=tbGradientCornerTopLeft

tbPatternNone produces a flat region with no gradient --- the Fill becomes fully transparent and the area behind the control shows through.

twinBASIC and LOGO copyright of "WaynePhillipsEA" author