GMImage.FillPattern
-------------------

Sets the pattern to use while filling drawn objects.

| Component | Version | macOS | Windows | Linux | Server | iOS SDK |
|---|---|---|---|---|---|---|
| [GraphicsMagick](component_GraphicsMagick.md) | [2.0](newinversion20.md) | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes |

MBS( "GMImage.FillPattern"; ImageRef; fillPatternRef ) 

**MBS**( **"GMImage.FillPattern";** /\* Sets the pattern to use while filling drawn objects. \*/  
**$ImageRef**; /\* The image reference number.e.g. 1 \*/   
**$fillPatternRef**) /\* The image reference number.e.g. 2 \*/ 

### Parameters

| Parameter | Description | Example |
|---|---|---|
| ImageRef | The image reference number. | 1 |
| fillPatternRef | The image reference number. | 2 |

### Result

Returns "OK" on success.

### Description

Sets the pattern to use while filling drawn objects.  
### Examples

Use one picture as pattern to draw round rectangle:

 # Load big picture   
Set Variable \[ $BigImageRef ; Value: MBS ("[GMImage.NewFromContainer](GMImageNewFromContainer.md)"; Combine Pictures::BigImage ) \]   
\# load pattern picture   
Set Variable \[ $SmallImageRef ; Value: MBS ("[GMImage.NewFromContainer](GMImageNewFromContainer.md)"; Combine Pictures::SmallImage ) \]   
\# Draw a rectangle using small image as pattern   
Set Variable \[ $Error ; Value: MBS ( "GMImage.FillPattern"; $BigImageRef ; $SmallImageRef ) \]   
Set Variable \[ $Error ; Value: MBS ( "[GMImage.DrawRoundRectangle](GMImageDrawRoundRectangle.md)"; $BigImageRef ; 100; 100; 300; 300; 20; 20) \]   
\# Write to container and free references   
Set Field \[ Combine Pictures::Result ; MBS ( "[GMImage.WriteToPNGContainer](GMImageWriteToPNGContainer.md)"; $BigImageRef ) \]   
Set Variable \[ $Error ; Value: MBS ("[GMImage.Free](GMImageFree.md)";$BigImageRef ) \]   
Set Variable \[ $Error ; Value: MBS ("[GMImage.Free](GMImageFree.md)";$SmallImageRef ) \]  
### See also

- [GMImage.DrawRoundRectangle](GMImageDrawRoundRectangle.md)
- [GMImage.Flatten](GMImageFlatten.md)
- [GMImage.Free](GMImageFree.md)
- [GMImage.New](GMImageNew.md)
- [GMImage.NewFromContainer](GMImageNewFromContainer.md)
- [GMImage.WriteToPNGContainer](GMImageWriteToPNGContainer.md)

### Example Databases

- [GraphicsMagick/Combine Pictures](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/GraphicsMagick/Combine%20Pictures.shtml#3ScriptAnchor_)

This function checks for a license.

Created 18th August 2014 , last changed 16th February 2023

  
[GMImage.Extent](GMImageExtent.md) - [GMImage.FindColorInColumn](GMImageFindColorInColumn.md)

[HTML Version](GMImageFillPattern.shtml)