{"title":"Use GetImageResource in a control add-in","url":"https://jonas-paprotka.de/docs/dev-itpro/developer/methods/devenv-getimageresource-method/","by":"JOP-AL","license":"Copyright (c) Microsoft Corporation. CC BY 4.0, https://creativecommons.org/licenses/by/4.0/; code samples MIT. From https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/developer/methods/devenv-getimageresource-method, MicrosoftDocs/dynamics365smb-devitpro-pb at 828b6ee (2026-11-19). Changed: includes filled in, links to this site, and for agents shortened without dropping a fact.","credit":"Microsoft Corporation, CC BY 4.0","origin":"https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/developer/methods/devenv-getimageresource-method","source":{"name":"Business Central developer and IT pro docs","repo":"https://github.com/MicrosoftDocs/dynamics365smb-devitpro-pb","commit":"828b6ee72fcd75755627cd6011f3d20899217ab2","date":"2026-11-19"},"checked":"2026-11-19","description":"Use the GetImageResource method in a Business Central control add-in to retrieve the URL of an image declared in the control add-in manifest.","date":"2026-10-05","meta":{"topic":"reference"},"outline":[{"level":1,"title":"Use GetImageResource in a control add-in","slug":"use-getimageresource-in-a-control-add-in","at":0,"chars":1116},{"level":2,"title":"Method signature","slug":"method-signature","at":399,"chars":83},{"level":2,"title":"Parameters","slug":"parameters","at":482,"chars":148},{"level":2,"title":"Return value","slug":"return-value","at":630,"chars":77},{"level":2,"title":"Example","slug":"example","at":707,"chars":254},{"level":2,"title":"Related information","slug":"related-information","at":961,"chars":155}],"text":"# Use GetImageResource in a control add-in\nGets the URL for an image resource specified in the control add-in manifest. Business Central stores the resource in the database as part of the control add-in's `.zip` file. The method returns a URL that the control add-in script can use to retrieve the resource.\nLearn more about control add-ins in Control add-in object<../devenv-control-addin-object>.\n## Method signature\n`string Microsoft.Dynamics.NAV.GetImageResource(resourceName)`\n## Parameters\nParameter|Description\nresourceName|Type: String<br /><br />The name of the image resource as declared in the control add-in manifest.\n## Return value\nType: String\nReturns a URL for the specified image resource.\n## Example\nThe following example assigns the returned URL to an image element with the ID pushpinImage.\n```javascript\nvar imageUrl = Microsoft.Dynamics.NAV.GetImageResource('PushpinImage.png');\ndocument.getElementById('pushpinImage').src = imageUrl;\n```\n## Related information\nAL method reference<../methods-auto/library>\ndevenv-getenvironment-method\ndevenv-invokeextensibility-method\ndevenv-openwindow-method"}