ImageConfig

This element is used to add a picture.

Declaration

ImageConfig element is declared as an instance of ImageConfig class. Reference Aspose.OMR.Generation.Config.Elements and Aspose.OMR.Generation.Config.Enums namespaces to use ImageConfig types without specifying the fully qualified namespace:

using Aspose.OMR.Generation.Config.Elements;
using Aspose.OMR.Generation.Config.Enums;

Image file name is specified in the Name property.

new ImageConfig() {
	Name = "image.jpg"
}

Full paths to all images used in the form must be provided to the template generator.

Required properties

Name Type Description
Name string Name of the image file.

Optional properties

Name Type Default value Description
Width int Original image width Image width, in pixels. Smaller or larger images will be resized.
Height int Original image height Image height, in pixels. Smaller or larger images will be resized.
XPosition int n/a Set the absolute position of the image relative to the left edge of the page.
Overrides the value of ImageAlign property.
YPosition int n/a Set the absolute position of the image relative to the top edge of the page.
ImageAlign AlignmentEnum AlignmentEnum.Left Horizontal image alignment.

Allowed child elements

None.

Example

TemplateConfig templateConfig = new TemplateConfig() {
	Children=new List<BaseConfig>() {
		new PageConfig() {
			Children = new List<BaseConfig>() {
				new ImageConfig() {
					Name = "logo.png",
					ImageAlign = AlignmentEnum.Center
				},
				new EmptyLineConfig(),
				new TextConfig() {
					Name = "Aspose.OMR for .NET",
					TextAlignment = AlignmentEnum.Center,
					FontSize = 24
				}
			}
		}
	}
};

Image