Spread Windows Forms 15.0
Spread Windows Forms 15.0 Product Documentation / Developer's Guide / Customizing Drawing / Creating Camera Shapes
In This Topic
    Creating Camera Shapes
    In This Topic

    You can create a snapshot of a range of cells and use that as a shape in the Spread control. The cell range can contain other shapes including charts. The following image displays a camera shape that contains a chart.

    Camera Shape with Chart

    For more information about using the Spread Designer to add camera shapes, see the Insert Menu topic. In general, properties that apply to the interior of the shape, do not apply to the camera shape.

    The camera shape cannot use another camera shape.

    Using Code

    1. Create a camera shape object by using the SpreadCameraShape class.
    2. Specify the range of cells that will become the shape with the Formula property.
    3. Set any other shape properties.
    4. Add the camera shape to the sheet.

    Example

    This example creates a blue triangle, adds text to a cell, and creates a camera shape that includes both.

    C#
    Copy Code
    fpSpread1.Sheets[0].Cells[1, 3].Text = "Test";
    FarPoint.Win.Spread.DrawingSpace.TriangleShape a = new FarPoint.Win.Spread.DrawingSpace.TriangleShape();
    a.BackColor = Color.Blue;
    fpSpread1.ActiveSheet.AddShape(a, 1, 1);
    FarPoint.Win.Spread.DrawingSpace.SpreadCameraShape test = new FarPoint.Win.Spread.DrawingSpace.SpreadCameraShape();
    test.Formula = "B1:D6";
    test.Location = new System.Drawing.Point(20, 20);
    fpSpread1.Sheets[0].AddShape(test);
    
    VB
    Copy Code
    fpSpread1.Sheets(0).Cells(1, 3).Text = "Test"
    Dim a As New FarPoint.Win.Spread.DrawingSpace.TriangleShape
    a.BackColor = Color.Blue
    fpSpread1.ActiveSheet.AddShape(a, 1, 1)
    Dim test As New FarPoint.Win.Spread.DrawingSpace.SpreadCameraShape()
    test.Formula = "B1:D6"
    test.Location = New System.Drawing.Point(20, 20)
    fpSpread1.Sheets(0).AddShape(test)
    

    The following image displays a camera shape that contains a triangle shape and a cell with text.

    Camera Shape with Triange Shape

    Using the Spread Designer

    1. Select a block of cells in the designer.
    2. Select the Insert menu.
    3. Select the camera shape icon.
    4. Click on the shape to move it.
    5. The Drawing Tools menu with additional options is displayed.
    6. From the File menu choose Apply and Exit to apply your changes to the component and exit Spread Designer.
    See Also