MindFusion.Reporting for Silverlight Programmer's Guide
Picture Class
Remarks See Also
 





Represents a report element that displays an image.

Namespace: MindFusion.Reporting.Silverlight
Assembly: MindFusion.Reporting.Silverlight

 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 Silverlight 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 Silverlight 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.DependencyObject
        System.Windows.UIElement
            System.Windows.FrameworkElement
                MindFusion.Reporting.Silverlight.ReportItem
                    MindFusion.Reporting.Silverlight.Picture

 See Also

Picture Members
MindFusion.Reporting.Silverlight Namespace