The "Picture" object
An object can display graphics in the following formats: BMP, PNG, JPG, GIF, TIFF, ICO, EMF, WMF. With the help of the "Picture" object, you can print your company logo, a photo of employee or any graphical information. The object looks like this:
An object can show data from the following sources:
Source | Description |
---|---|
File with a picture | Picture is loaded from a file and is saved inside the report. Picture is stored in the Image property. |
Data column | Picture from a data column. Name of the column is stored in the DataColumn property. |
File name | Picture is loaded from a file with the given name. Name of file is stored in the ImageLocation property. Picture is never stored inside the report. You should distribute the picture file along with the report. |
URL | Picture is loaded from the internet every time the report is created. Image is never stored inside the report. URL is stored the in the ImageLocation property. |
In order to call a picture editor, double click on the object. In the editor, you can choose the data source for the picture:
In order to bind the object to a data column, click on the small button in the upper right corner of the object and choose the data column from a list:
You also can drag&drop a data column from the "Data" window into the report page. In this case the "Picture" object is created which contains a link to the column. The column you drag should have the byte[]
data type.
In the context menu of the "Picture" object you can choose the size mode:
- AutoSize - The object gets the size of the picture;
- CenterImage - The picture is centered inside the object;
- Normal - The picture is displayed in the left corner of the object;
- StretchImage - The picture is stretched to the size of the object;
- Zoom - The picture is stretched to the size of the object in accordance with the aspect ratio.
The difference between modes is shown in the following picture:
The "Picture" object has the following properties:
Property | Description |
---|---|
Angle | The rotation angle, in degrees. Possible values for this property are 0, 90, 180, 270. |
SizeMode | The size mode. |
Transparency | The degree of transparency of the pictures. The property can have values between 0 and 1. The value 0 (by default) means that the picture is opaque. |
TransparentColor | The color which will be transparent when displaying the picture. |
Image | The picture. |
DataColumn | The data column that this object is bound to. |
ImageLocation | This property can contain name of the file or URL. The picture will be loaded from this location when building the report. |
Padding | The padding, in pixels. |
ShowErrorImage | Shows the "No picture" picture, in case when the picture is empty. This property makes sense to use if the picture is downloaded from the Internet. |