Class PictureObjectBase
the base class for all picture objects
Inheritance
Implements
Inherited Members
Namespace: FastReport
Assembly: FastReport.Base.dll
Syntax
public abstract class PictureObjectBase : ReportComponentBase, IFRSerializable
Constructors
PictureObjectBase()
Declaration
public PictureObjectBase()
Properties
Angle
Gets or sets the image rotation angle, in degrees. Possible values are 0, 90, 180, 270.
Declaration
public int Angle { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 |
DataColumn
Gets or sets the data column name to get the image from.
Declaration
public string DataColumn { get; set; }
Property Value
Type | Description |
---|---|
System.String |
Grayscale
Gets or sets a value indicating that the image should be displayed in grayscale mode.
Declaration
public virtual bool Grayscale { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
Height
Gets or sets the height of the object.
Declaration
public override float Height { get; set; }
Property Value
Type | Description |
---|---|
System.Single |
Overrides
Remarks
This property value is measured in the screen pixels. Use Units class to convert a value to desired units.
ImageAlign
Gets or sets the alignment of a image in the border.
Declaration
public ImageAlign ImageAlign { get; set; }
Property Value
Type | Description |
---|---|
ImageAlign |
ImageHeight
Return base size of image, internal use only
Declaration
protected abstract float ImageHeight { get; }
Property Value
Type | Description |
---|---|
System.Single |
ImageLocation
Gets or sets the path for the image to display in the PictureObject.
Declaration
public string ImageLocation { get; set; }
Property Value
Type | Description |
---|---|
System.String |
Remarks
This property may contain the path to the image file as well as external URL.
ImageSourceExpression
Gets or sets the expression that determines the source for the image to display in the PictureObject.
Declaration
public string ImageSourceExpression { get; set; }
Property Value
Type | Description |
---|---|
System.String |
Remarks
The result of the expression should be data column name or path to the image file. The data column name will be saved to the DataColumn property. The path will be savetd to the ImageLocation property.
ImageWidth
Return base size of image, internal use only
Declaration
protected abstract float ImageWidth { get; }
Property Value
Type | Description |
---|---|
System.Single |
IsDataColumn
Gets a value indicating that the image stored in the databases column
Declaration
public bool IsDataColumn { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
IsFileLocation
Gets a value indicating that the image stored in the separate file
Declaration
public bool IsFileLocation { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
IsWebLocation
Gets a value indicating that the image stored in the Web
Declaration
public bool IsWebLocation { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
MaxHeight
Gets or sets the maximum height of a Picture object, in pixels.
Declaration
public float MaxHeight { get; set; }
Property Value
Type | Description |
---|---|
System.Single |
Remarks
Use this property to restrict the object size if the SizeMode property is set to AutoSize.
MaxWidth
Gets or sets the maximum width of a Picture object, in pixels.
Declaration
public float MaxWidth { get; set; }
Property Value
Type | Description |
---|---|
System.Single |
Remarks
Use this property to restrict the object size if the SizeMode property is set to AutoSize.
Padding
Gets or sets padding within the PictureObject.
Declaration
public Padding Padding { get; set; }
Property Value
Type | Description |
---|---|
Padding |
Shape
Gets or sets a shape kind.
Declaration
public ShapeKind Shape { get; set; }
Property Value
Type | Description |
---|---|
ShapeKind |
ShowErrorImage
Gets or sets a value indicating whether the PictureObject should display the error indicator if there is no image in it.
Declaration
public bool ShowErrorImage { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
SizeMode
Gets or sets a value that specifies how an image is positioned within a PictureObject.
Declaration
public virtual PictureBoxSizeMode SizeMode { get; set; }
Property Value
Type | Description |
---|---|
PictureBoxSizeMode |
Width
Gets or sets the width of the object.
Declaration
public override float Width { get; set; }
Property Value
Type | Description |
---|---|
System.Single |
Overrides
Remarks
This property value is measured in the screen pixels. Use Units class to convert a value to desired units.
Methods
Assign(Base)
Copies the contents of another, similar object.
Declaration
public override void Assign(Base source)
Parameters
Type | Name | Description |
---|---|---|
Base | source | Source object to copy the contents from. |
Overrides
Remarks
Call Assign to copy the properties from another object of the same type. The standard form of a call to Assign is
destination.Assign(source);
which tells the destination object to copy the contents of the source object to itself. In this method, all child objects are ignored. If you want to copy child objects, use the AssignAll method.
See Also
CalculateUri()
Calculates URI from ImageLocation
Declaration
public Uri CalculateUri()
Returns
Type | Description |
---|---|
Uri |
Draw(FRPaintEventArgs)
Declaration
public override void Draw(FRPaintEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
FRPaintEventArgs | e |
Overrides
DrawImage(FRPaintEventArgs)
Declaration
public abstract void DrawImage(FRPaintEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
FRPaintEventArgs | e |
DrawImageInternal2(IGraphics, PointF, PointF, PointF)
Declaration
protected abstract void DrawImageInternal2(IGraphics graphics, PointF upperLeft, PointF upperRight, PointF lowerLeft)
Parameters
Type | Name | Description |
---|---|---|
IGraphics | graphics | |
PointF | upperLeft | |
PointF | upperRight | |
PointF | lowerLeft |
GetExpressions()
Gets all expressions contained in the object.
Declaration
public override string[] GetExpressions()
Returns
Type | Description |
---|---|
System.String[] | Array of expressions or null if object contains no expressions. |
Overrides
Remarks
Do not call this method directly. You may override it if you are developing a new component for FastReport.
This method is called by FastReport each time before run a report. FastReport do this to collect all expressions and compile them. For example, GetExpressions method of the TextObject class parses the text and returns all expressions found in the text.
GetImageAngleTransform(RectangleF, Single, Single, Single, Single, Single, Single, out PointF, out PointF, out PointF)
gets points for transform this image
Declaration
public void GetImageAngleTransform(RectangleF drawRect, float imageWidth, float imageHeight, float scaleX, float scaleY, float offsetX, float offsetY, out PointF upperLeft, out PointF upperRight, out PointF lowerLeft)
Parameters
Type | Name | Description |
---|---|---|
RectangleF | drawRect | the box where to draw image |
System.Single | imageWidth | image width |
System.Single | imageHeight | image height |
System.Single | scaleX | scale horizontal |
System.Single | scaleY | scale vertical |
System.Single | offsetX | offset of left |
System.Single | offsetY | offset of top |
PointF | upperLeft | out start of vectors |
PointF | upperRight | out end of frist vector |
PointF | lowerLeft | out end of second vector |
LoadImage()
Loads image
Declaration
public abstract void LoadImage()
LoadImageAsync(CancellationToken)
Loads image asynchronously
Declaration
public virtual Task LoadImageAsync(CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
System.Threading.CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task |
Remarks
You mustn't call this method when override it in nested class because it will call synchronous implementation
MovePointOnAngle(PointF, SizeF, Single)
Moves the point on specified angle
Declaration
public PointF MovePointOnAngle(PointF p, SizeF size, float fangle)
Parameters
Type | Name | Description |
---|---|---|
PointF | p | |
SizeF | size | |
System.Single | fangle |
Returns
Type | Description |
---|---|
PointF |
ResetImageIndex()
Reset index of image
Declaration
protected abstract void ResetImageIndex()
RestoreState()
Restores the object's state after printing it.
Declaration
public override void RestoreState()
Overrides
Remarks
This method is called by the report engine after processing the object.
Do not call it directly. You may override it if you are developing a new FastReport component. In this method you should restore the object properties that were saved by the SaveState() method.
rotateVector(PointF, Single)
Rotates vector on specified angle
Declaration
public PointF rotateVector(PointF p, float fangle)
Parameters
Type | Name | Description |
---|---|---|
PointF | p | |
System.Single | fangle |
Returns
Type | Description |
---|---|
PointF |
SaveState()
Saves the object's state before printing it.
Declaration
public override void SaveState()
Overrides
Remarks
This method is called by the report engine before processing the object.
Do not call it directly. You may override it if you are developing a new FastReport component. In this method you should save any object properties that may be changed during the object printing. The standard implementation saves the object's bounds, visibility, bookmark and hyperlink.
Serialize(FRWriter)
Declaration
public override void Serialize(FRWriter writer)
Parameters
Type | Name | Description |
---|---|---|
FRWriter | writer |
Overrides
UpdateAutoSize()
When auto size was updated, internal use only
Declaration
protected void UpdateAutoSize()