Image (JPG, PNG, GIF, ICO) Web Resources
Use image Web resources to make images available for use in Microsoft Dynamics CRM.
Capabilities of Image Web resources
With image Web resources you can add images where you need them. Common uses include the following:
-
Custom entity icons
-
Icons for custom Ribbon controls and SiteMap subareas
-
Decorative graphics for entity forms and Web page Web resources.
-
Background images that are used by CSS Web resources
Limitations of Image Web Resources
Like all Web resources, image Web resources use the Microsoft Dynamics CRM security context. Only licensed Microsoft Dynamics CRM users who have the necessary privileges can access them.
Only the four specified types of image files (*.jpg, *.png, *.gif, *.ico) are supported.
Image Web Resource Tasks
Image Web resources can be used where ever you have a requirement to reference an image file. The following are three ways to reference images:
Reference an Image Web Resource from a Web Page Web Resource
Reference an Image Web Resource from a Microsoft CRM Form
Reference an Image Web Resource from a Ribbon element or from the Site Map SubArea
Reference an Image Web Resource from a Web Page Web Resource
All Web resources can use relative URLs to reference each other. In the following example, for the Web page (HTML) Web resource new_/content/contentpage.htm to reference the image Web resource new_/Images/image1.png, add the following HTML code to new_/content/contentpage.htm:
Reference an Image Web Resource from a Microsoft Dynamics CRM Form
To add an image to an entity form
-
Navigate to the Form Editor for an entity.
-
Select where you want to add the image in the form.
-
On the Insert tab, click Web Resource.
-
In the Add Web Resource dialog box, in the General tab, select the Web resource image that you want to add.
-
Specify a name for the Web resource. You can also specify a label and alternative text.
-
On the Formatting tab, you can define:
-
The number of columns the images should use.
-
The number of rows the images should use, or if it should automatically expand to use available space.
-
The size of the image using the following options:
- Stretch to fit
- Stretch to fit (maintain aspect ratio)
- Original
- Specific
- Stretch to fit
-
If you select “Specific,” you can enter the desired height and width in pixels.
-
The number of columns the images should use.
-
Click OK to close the Add Web Resource dialog box.
-
You must save your changes and publish the form before users can see the image in the form.
Reference an Image Web Resource from a Ribbon element or from the Site Map SubArea
Use the $webresource: directive to specify a Web resource image to use as an icon in the ribbon or in the application navigation using Site Map. The following sample shows how to specify icons for a button in the ribbon.
<Button Id="MyISV.opportunity.form.actions.FlyoutAnchor.Button.1" Image16by16="$webresource:new_/icons/oneIcon16.png" Image32by32="$webresource:new_/icons/oneIcon32.png" />
Note |
|---|
Using the $webresource: directive adds a solution dependency that prevents the referenced image Web resources from being deleted as long as they are used by another solution component. |
See Also
Send comments about this topic to Microsoft.
© 2012 Microsoft Corporation. All rights reserved.
Note