MenuItem.GetImage
-----------------

Queries the image for this menu item.

| Component | Version | macOS | Windows | Linux | Server | iOS SDK |
|---|---|---|---|---|---|---|
| [Menu](component_Menu.md) | [4.1](newinversion41.md) | ✅ Yes | ✅ Yes | ❌ No | ❌ No | ❌ No |

MBS( "MenuItem.GetImage"; Item { ; ImageType; FileName } ) 

**MBS**( **"MenuItem.GetImage";** /\* Queries the image for this menu item. \*/  
**$Item**; /\* The reference to the menu item.   
Please create one with [MenuItem.CreateMenuItem](MenuItemCreateMenuItem.md) or [MenuItem.CreateSeparator](MenuItemCreateSeparator.md). \*/   
**$ImageType**; /\* Optional; The type of image to return.   
Either JPEG, PNG, GIF or BMP. Default is JPEG.e.g. "JPEG" \*/   
**$FileName**) /\* Optional; The filename to use for the picture.   
Default is "image" with the extension matching the image type.e.g. "test.jpg" \*/ 

### Parameters

| Parameter | Description | Example | Flags |
|---|---|---|---|
| Item | The reference to the menu item.    Please create one with [MenuItem.CreateMenuItem](MenuItemCreateMenuItem.md) or [MenuItem.CreateSeparator](MenuItemCreateSeparator.md). | $item |  |
| ImageType | The type of image to return.    Either JPEG, PNG, GIF or BMP. Default is JPEG. | "JPEG" | Optional |
| FileName | The filename to use for the picture.    Default is "image" with the extension matching the image type. | "test.jpg" | Optional |

### Result

Returns image or error.

### Description

Queries the image for this menu item.  
See also [MenuItem.SetImage](MenuItemSetImage.md).  
Please call [GMImage.Release](GMImageRelease.md) later to free memory for this image.  
### See also

- [GMImage.Release](GMImageRelease.md)
- [MenuItem.CreateMenuItem](MenuItemCreateMenuItem.md)
- [MenuItem.CreateSeparator](MenuItemCreateSeparator.md)
- [MenuItem.GetItalic](MenuItemGetItalic.md)
- [MenuItem.GetPath](MenuItemGetPath.md)
- [MenuItem.GetTag](MenuItemGetTag.md)
- [MenuItem.GetTitle](MenuItemGetTitle.md)
- [MenuItem.SetItalic](MenuItemSetItalic.md)
- [MenuItem.SetTag](MenuItemSetTag.md)
- [MenuItem.SetTitle](MenuItemSetTitle.md)

This function checks for a license.

Created 18th August 2014 , last changed 29th September 2020

  
[MenuItem.GetHidden](MenuItemGetHidden.md) - [MenuItem.GetItalic](MenuItemGetItalic.md)

[HTML Version](MenuItemGetImage.shtml)