MindFusion.Wpf Pack Programmer's Guide
Picture Class
Remarks See Also
 





Represents a report element that displays an image.

Namespace: MindFusion.Reporting.Wpf
Assembly: MindFusion.Reporting.Wpf

 Syntax

C#  Copy Code

public class Picture : ReportItem

Visual Basic  Copy Code

Public Class Picture
    Inherits ReportItem

 Remarks

In order to associate an image with the Picture element, assign any WPF System.Windows.Media.ImageSource object to its Image property. The stretching and alignment of the displayed image can be specified through the HorizontalAlignment and VerticalAlignment properties.

Alternatively, pictures can be bound to fields in a data source. To do this, the picture must be placed in a data-bound context and its Image property must be bound to the respective data field using standard WPF bindings.

 Example

The following sample code demonstrates the use of Picture objects in XAML:

XAML  Copy Code

<r:Report x:Name="ProductCategories">
  <r:Report.Resources>
    <l:ByteToPictureConverter x:Key="PictureConverter" />
  </r:Report.Resources>
  <r:Page>
    <r:DataRange DataSource="{Binding Categories}" Size="160,160" Background="#F5E49C" ArrangeByX="True" Margin="0,0,5,5" >
      <r:DataRange.ItemTemplate>
        <DataTemplate>
          <r:ItemContainer>
            <r:Label Text="{Binding CategoryName}" Size="100%,15" HorizontalAlignment="Center" VerticalAlignment="Center" />
            <r:Picture Image="{Binding Picture, Converter={StaticResource PictureConverter}}" Location="5,15" Size="150,150" />
          </r:ItemContainer>
        </DataTemplate>
      </r:DataRange.ItemTemplate>
    </r:DataRange>
  </r:Page>
</r:Report>

 Inheritance Hierarchy

System.Object
    System.Windows.Threading.DispatcherObject
        System.Windows.DependencyObject
            System.Windows.Media.Visual
                System.Windows.UIElement
                    System.Windows.FrameworkElement
                        MindFusion.Reporting.Wpf.ReportItem
                            MindFusion.Reporting.Wpf.Picture

 See Also

Picture Members
MindFusion.Reporting.Wpf Namespace