Show / Hide Table of Contents

Class PictureObject

Represents a Picture object that can display pictures.

Inheritance
System.Object
Base
ComponentBase
ReportComponentBase
PictureObjectBase
PictureObject
Implements
IFRSerializable
Inherited Members
PictureObjectBase.Angle
PictureObjectBase.DataColumn
PictureObjectBase.Height
PictureObjectBase.ImageLocation
PictureObjectBase.IsDataColumn
PictureObjectBase.IsFileLocation
PictureObjectBase.IsWebLocation
PictureObjectBase.MaxHeight
PictureObjectBase.MaxWidth
PictureObjectBase.Padding
PictureObjectBase.ShowErrorImage
PictureObjectBase.SizeMode
PictureObjectBase.Width
PictureObjectBase.ImageAlign
PictureObjectBase.CalculateUri()
PictureObjectBase.Draw(FRPaintEventArgs)
PictureObjectBase.GetImageAngleTransform(RectangleF, Single, Single, Single, Single, Single, Single, PointF, PointF, PointF)
PictureObjectBase.MovePointOnAngle(PointF, SizeF, Single)
PictureObjectBase.RestoreState()
PictureObjectBase.rotateVector(PointF, Single)
PictureObjectBase.SaveState()
PictureObjectBase.UpdateAutoSize()
PictureObjectBase.GetExpressions()
ReportComponentBase.BeforePrint
ReportComponentBase.AfterPrint
ReportComponentBase.AfterData
ReportComponentBase.Click
ReportComponentBase.Exportable
ReportComponentBase.Border
ReportComponentBase.Fill
ReportComponentBase.FillColor
ReportComponentBase.Bookmark
ReportComponentBase.Hyperlink
ReportComponentBase.CanGrow
ReportComponentBase.CanShrink
ReportComponentBase.GrowToBottom
ReportComponentBase.ShiftMode
ReportComponentBase.Style
ReportComponentBase.EvenStyle
ReportComponentBase.HoverStyle
ReportComponentBase.EvenStylePriority
ReportComponentBase.PrintOn
ReportComponentBase.BeforePrintEvent
ReportComponentBase.AfterPrintEvent
ReportComponentBase.AfterDataEvent
ReportComponentBase.ClickEvent
ReportComponentBase.FlagSimpleBorder
ReportComponentBase.FlagUseBorder
ReportComponentBase.FlagUseFill
ReportComponentBase.FlagPreviewVisible
ReportComponentBase.FlagSerializeStyle
ReportComponentBase.FlagProvidesHyperlinkValue
ReportComponentBase.Cursor
ReportComponentBase.MouseMoveEvent
ReportComponentBase.MouseUpEvent
ReportComponentBase.MouseDownEvent
ReportComponentBase.MouseEnterEvent
ReportComponentBase.MouseLeaveEvent
ReportComponentBase.ApplyStyle(Style)
ReportComponentBase.SaveStyle()
ReportComponentBase.RestoreStyle()
ReportComponentBase.DrawBackground(FRPaintEventArgs)
ReportComponentBase.IsVisible(FRPaintEventArgs)
ReportComponentBase.OnClick(EventArgs)
ReportComponentBase.OnAfterLoad()
ReportComponentBase.HasClickListeners()
ReportComponentBase.CalcHeight()
ReportComponentBase.OnBeforePrint(EventArgs)
ReportComponentBase.OnAfterPrint(EventArgs)
ReportComponentBase.OnAfterData(EventArgs)
ComponentBase.AbsBottom
ComponentBase.AbsBounds
ComponentBase.AbsLeft
ComponentBase.AbsRight
ComponentBase.AbsTop
ComponentBase.Anchor
ComponentBase.Bottom
ComponentBase.Bounds
ComponentBase.ClientSize
ComponentBase.Dock
ComponentBase.GroupIndex
ComponentBase.Left
ComponentBase.Right
ComponentBase.Tag
ComponentBase.Top
ComponentBase.Visible
ComponentBase.Printable
Base.Name
Base.Restrictions
Base.Flags
Base.Parent
Base.BaseName
Base.ClassName
Base.Report
Base.Page
Base.ChildObjects
Base.AllObjects
Base.ZOrder
Base.IsAncestor
Base.IsDesigning
Base.IsPrinting
Base.IsRunning
Base.OriginalComponent
Base.SetProp(Base, Base)
Base.FloatDiff(Single, Single)
Base.DeserializeSubItems(FRReader)
Base.ExtractDefaultMacros(String)
Base.SetFlags(Flags, Boolean)
Base.SetReport(Report)
Base.SetName(String)
Base.SetParent(Base)
Base.SetParentCore(Base)
Base.FindObject(String)
Base.CreateUniqueName()
Base.Clear()
Base.BaseAssign(Base)
Base.AssignAll(Base)
Base.HasParent(Base)
Base.HasFlag(Flags)
Base.HasRestriction(Restrictions)
Base.InvokeEvent(String, Object)
Base.GetCustomScript()
Base.ExtractMacros()
Base.IsHaveToConvert(Object)
Base.GetConvertedObjects()
Base.ForEachAllConvectedObjects(Object)
Namespace: FastReport
Assembly: FastReport.OpenSource.dll
Syntax
public class PictureObject : PictureObjectBase, IFRSerializable
Remarks

The Picture object can display the following kind of pictures:

  • picture that is embedded in the report file. Use the Image property to do this;
  • picture that is stored in the database BLOb field. Use the property to specify the name of data column you want to show;
  • picture that is stored in the local disk file. Use the property to specify the name of the file;
  • picture that is stored in the Web. Use the property to specify the picture's URL.

Use the property to specify a size mode. The and properties can be used to restrict the image size if SizeMode is set to AutoSize.

The TransparentColor property can be used to display an image with transparent background. Use the Transparency property if you want to display semi-transparent image.

Constructors

PictureObject()

Initializes a new instance of the PictureObject class with default settings.

Declaration
public PictureObject()

Properties

Grayscale

Gets or sets a value indicating that the image should be displayed in grayscale mode.

Declaration
public override bool Grayscale { get; set; }
Property Value
Type Description
System.Boolean
Overrides
PictureObjectBase.Grayscale

GrayscaleHash

Gets or sets a hash of grayscale svg image

Declaration
public int GrayscaleHash { get; set; }
Property Value
Type Description
System.Int32

Image

Gets or sets the image.

Declaration
public virtual Image Image { get; set; }
Property Value
Type Description
Image
Remarks

By default, image that you assign to this property is never disposed - you should take care about it. If you want to dispose the image when this PictureObject is disposed, set the ShouldDisposeImage property to true right after you assign an image:

myPictureObject.Image = new Bitmap("file.bmp");
myPictureObject.ShouldDisposeImage = true;

ImageHeight

Return base size of image, internal use only

Declaration
protected override float ImageHeight { get; }
Property Value
Type Description
System.Single
Overrides
PictureObjectBase.ImageHeight

ImageWidth

Return base size of image, internal use only

Declaration
protected override float ImageWidth { get; }
Property Value
Type Description
System.Single
Overrides
PictureObjectBase.ImageWidth

ShouldDisposeImage

Gets or sets a value indicating that the image stored in the Image property should be disposed when this object is disposed.

Declaration
public bool ShouldDisposeImage { get; set; }
Property Value
Type Description
System.Boolean
Remarks

By default, image assigned to the Image property is never disposed - you should take care about it. If you want to dispose the image when this PictureObject is disposed, set this property to true right after you assign an image to the Image property.

Tile

Gets or sets a value indicating that the image should be tiled.

Declaration
public bool Tile { get; set; }
Property Value
Type Description
System.Boolean

Transparency

Gets or sets the transparency of the PictureObject.

Declaration
public float Transparency { get; set; }
Property Value
Type Description
System.Single
Remarks

Valid range of values is 0..1. Default value is 0.

TransparentColor

Gets or sets the color of the image that will be treated as transparent.

Declaration
public Color TransparentColor { get; set; }
Property Value
Type Description
Color

TransparentImage

Gets or sets a bitmap transparent image

Declaration
public Bitmap TransparentImage { get; set; }
Property Value
Type Description
Bitmap

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
PictureObjectBase.Assign(Base)
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(Base) method.

See Also
AssignAll(Base)

Deserialize(FRReader)

Declaration
public override void Deserialize(FRReader reader)
Parameters
Type Name Description
FRReader reader
Overrides
ReportComponentBase.Deserialize(FRReader)

Dispose(Boolean)

Declaration
protected override void Dispose(bool disposing)
Parameters
Type Name Description
System.Boolean disposing
Overrides
Base.Dispose(Boolean)

DisposeImage()

Disposes image

Declaration
public void DisposeImage()

DrawImage(FRPaintEventArgs)

Draws the image.

Declaration
public override void DrawImage(FRPaintEventArgs e)
Parameters
Type Name Description
FRPaintEventArgs e

Paint event args.

Overrides
PictureObjectBase.DrawImage(FRPaintEventArgs)

DrawImageInternal2(Graphics, PointF, PointF, PointF)

Declaration
protected override void DrawImageInternal2(Graphics graphics, PointF upperLeft, PointF upperRight, PointF lowerLeft)
Parameters
Type Name Description
Graphics graphics
PointF upperLeft
PointF upperRight
PointF lowerLeft
Overrides
PictureObjectBase.DrawImageInternal2(Graphics, PointF, PointF, PointF)

FinalizeComponent()

Performs a finalization after the report is finished.

Declaration
public override void FinalizeComponent()
Overrides
ReportComponentBase.FinalizeComponent()
Remarks

This method is used by the report engine, do not call it directly.

ForceLoadImage()

Forces loading the image from a data column.

Declaration
public void ForceLoadImage()
Remarks

Call this method in the AfterData event handler to force loading an image into the Image property. Normally, the image is stored internally as byte[] array and never loaded into the Image property, to save the time. The side effect is that you can't analyze the image properties such as width and height. If you need this, call this method before you access the Image property. Note that this will significantly slow down the report.

GetData()

Gets the data from a datasource that the object is connected to.

Declaration
public override void GetData()
Overrides
ReportComponentBase.GetData()
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 get the data from a datasource that the object is connected to.

InitializeComponent()

Initializes the object before running a report.

Declaration
public override void InitializeComponent()
Overrides
ReportComponentBase.InitializeComponent()
Remarks

This method is used by the report engine, do not call it directly.

LoadImage()

Loads image

Declaration
public override void LoadImage()
Overrides
PictureObjectBase.LoadImage()

ResetImageIndex()

Declaration
protected override void ResetImageIndex()
Overrides
PictureObjectBase.ResetImageIndex()

Serialize(FRWriter)

Declaration
public override void Serialize(FRWriter writer)
Parameters
Type Name Description
FRWriter writer
Overrides
PictureObjectBase.Serialize(FRWriter)

SetImageData(Byte[])

Sets image data to FImageData

Declaration
public void SetImageData(byte[] data)
Parameters
Type Name Description
System.Byte[] data

Implements

IFRSerializable
Back to top Generated by DocFX