GMImage.GetWidth
----------------

Returns the Image width.

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

MBS( "GMImage.GetWidth"; ImageRef ) 

**MBS**( **"GMImage.GetWidth";** /\* Returns the Image width. \*/  
**$ImageRef**) /\* The image reference number.e.g. 1 \*/ 

### Parameters

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

### Result

Returns the Image width.

### Description

Returns the Image width.  
### Examples

Show with and height

 Let ( \[   
$Image = MBS ("[GMImage.NewFromContainer](GMImageNewFromContainer.md)"; GraphicsMagick::image );   
$Width = MBS ("GMImage.GetWidth";$Image );   
$Height = MBS ("[GMImage.GetHeight](GMImageGetHeight.md)";$Image );   
$Error = MBS ("[GMImage.Release](GMImageRelease.md)";$Image )  
\];   
$Width &amp; " x " &amp; $Height )  
Query size of image into $h and $w:

 Set Variable \[ $Image ; Value: MBS ( "[GMImage.NewFromContainer](GMImageNewFromContainer.md)"; ImageView::ImageContainer ) \]   
Set Variable \[ $w ; Value: MBS ( "GMImage.GetWidth"; $Image ) \]   
Set Variable \[ $h ; Value: MBS ( "[GMImage.GetHeight](GMImageGetHeight.md)"; $Image ) \]   
Set Variable \[ $r ; Value: MBS ( "[GMImage.Release](GMImageRelease.md)"; $Image ) \]  
### See also

- [GMImage.GetHeight](GMImageGetHeight.md)
- [GMImage.GetMatte](GMImageGetMatte.md)
- [GMImage.GetQuiet](GMImageGetQuiet.md)
- [GMImage.GetView](GMImageGetView.md)
- [GMImage.Scale](GMImageScale.md)
- [GMImage.SetPixelColor](GMImageSetPixelColor.md)
- [ImageView.CreateWithControl](ImageViewCreateWithControl.md)
- [ImageView.CreateWithSize](ImageViewCreateWithSize.md)
- [XL.Book.AddPictureContainer](XLBookAddPictureContainer.md)
- [XL.Sheet.SetPictureWithSize](XLSheetSetPictureWithSize.md)

### Example Databases

- [Barcode/Barcode Generation](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/Barcode/Barcode%20Generation.shtml#3ScriptAnchor_)
- [Barcode/Swiss QR-Code for invoices/Swiss QR-Code for invoices ISO 20022](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/Barcode/Swiss%20QR-Code%20for%20invoices/Swiss%20QR-Code%20for%20invoices%20ISO%2020022.shtml#11ScriptAnchor_)
- [DynaPDF/Scan with WIA to PDF](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/DynaPDF/Scan%20with%20WIA%20to%20PDF.shtml#24ScriptAnchor_)
- [GraphicsMagick/Clip Image](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/GraphicsMagick/Clip%20Image.shtml#1ScriptAnchor_)
- [GraphicsMagick/Combine Pictures](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/GraphicsMagick/Combine%20Pictures.shtml#1ScriptAnchor_)
- [GraphicsMagick/Crop with Clicks](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/GraphicsMagick/Crop%20with%20Clicks.shtml#3ScriptAnchor_)
- [GraphicsMagick/Find Pixels](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/GraphicsMagick/Find%20Pixels.shtml#1ScriptAnchor_)
- [GraphicsMagick/GraphicsMagick Sample](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/GraphicsMagick/GraphicsMagick%20Sample.shtml#1ScriptAnchor_)
- [GraphicsMagick/Image Croping](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/GraphicsMagick/Image%20Croping.shtml#1ScriptAnchor_)
- [GraphicsMagick/Image Scaling](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/GraphicsMagick/Image%20Scaling.shtml#1ScriptAnchor_)

### Blog Entries

- [MBS Plugin Advent calendar: 16 - GraphicsMagick](https://www.mbsplugins.de/archive/2023-12-16/MBS_Plugin_Advent_calendar_16_/monkeybreadsoftware_blog_filemaker)
- [Tips and tricks with MBS](https://www.mbsplugins.de/archive/2023-08-10/Tips_and_tricks_with_MBS/monkeybreadsoftware_blog_filemaker)
- [GraphicsMagick in FileMaker, part 24](https://www.mbsplugins.de/archive/2022-12-24/GraphicsMagick_in_FileMaker_pa/monkeybreadsoftware_blog_filemaker)
- [GraphicsMagick in FileMaker, part 10](https://www.mbsplugins.de/archive/2022-12-10/GraphicsMagick_in_FileMaker_pa/monkeybreadsoftware_blog_filemaker)
- [GraphicsMagick in FileMaker, part 7](https://www.mbsplugins.de/archive/2022-12-07/GraphicsMagick_in_FileMaker_pa/monkeybreadsoftware_blog_filemaker)
- [GraphicsMagick in FileMaker, part 2](https://www.mbsplugins.de/archive/2022-12-02/GraphicsMagick_in_FileMaker_pa/monkeybreadsoftware_blog_filemaker)
- [Create PDF from scanned images and skip blank pages](https://www.mbsplugins.de/archive/2019-03-13/Create_PDF_from_scanned_images/monkeybreadsoftware_blog_filemaker)
- [Circle crop images in FileMaker with MBS Plugin](https://www.mbsplugins.de/archive/2018-01-18/Circle_crop_images_in_FileMake/monkeybreadsoftware_blog_filemaker)
- [QR Codes for Invoices in Switzerland](https://www.mbsplugins.de/archive/2017-12-20/QR_Codes_for_Invoices_in_Switz/monkeybreadsoftware_blog_filemaker)

### FileMaker Magazin

- [Ausgabe 6/2020, Seite 37](https://filemaker-magazin.de/neuigkeit/4118-Appetithappen-FMM_202006)
- [Ausgabe 5/2018, Seite 29](https://filemaker-magazin.de/neuigkeit/4011-Appetithappen-FMM_201805)
- [Ausgabe 5/2011, Seite 32](https://filemaker-magazin.de/neuigkeit/3506-Appetithappen-FMM_201105-06)

This function checks for a license.

Created 18th August 2014 , last changed 21st December 2018

  
[GMImage.GetView](GMImageGetView.md) - [GMImage.GetXMP](GMImageGetXMP.md)

[HTML Version](GMImageGetWidth.shtml)