The next object to look at is the “Picture” object. It is also frequently used in reports. Using this object you can insert logos, photos (e.g. of an employee) or any other pictorial information. The object can display graphics in “BMP”, “JPEG”, “ICO”, “WMF” or “EMF” format.
Let’s look at the capabilities of this object. Create a blank report and place a “Picture” object on the report page. If the picture editor does not open automatically then double-click on the "Picture" object. You can load any picture from a graphic file or clear the existing picture and close the editor by clicking on the green Tick.
Some of the object's properties are available on the context menu as well as in the object inspector:
- AutoSize
- Stretch : enabled by default
- Center
- KeepAspectRatio : enabled by default
When “AutoSize” is enabled the object is re-sized up to the size of the picture it contains. Sometimes this can be useful if database pictures of differing size are being displayed. “AutoSize” is disabled by default.
“Stretch” is enabled by default. This property stretches the picture within the object. Change the object’s size using the mouse and you will see that the whole picture is always displayed within the object’s frame. If “Stretch” is disabled the picture (or only part of it) is displayed at its original size. This behaviour differs from “AutoSize” in that you have control of the object's frame size, which can be larger or smaller than the picture it contains. With “AutoSize” enabled you have no control over the object's frame size.
The “Center” property aligns the picture within the object.
“KeepAspectRatio” is enabled by default : it keeps the picture from distorting when the object’s size is changed. This property is only effective when “Stretch” is also enabled. With “KeepAspectRatio” enabled a drawn circle remains a circle without turning into an oval, whatever the “Picture” object's size. The stretched picture occupies only that part of the internal space of the object needed to display it with the correct aspect ratio. When disabled, the picture will be stretched to fill the object's frame and will be distorted if the frame’s aspect ratio is not the same as the picture's aspect ratio.
Another useful property available only in the object inspector is "FileLink". Entering a filename, such as c:\picture.bmp, or a variable which contains a filename, such as [picture_file], will load the picture from the named file when you run the report.
|