Spread Windows Forms 6.0 Product Documentation
Creating Camera Shapes
Support Options
Spread Windows Forms 6.0 Product Documentation > Developer's Guide > Customizing Sheet Interaction > Customizing Drawing > Creating Camera Shapes

Glossary Item Box

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 designer to add camera shapes, see the Insert Menu. In general, properties that apply to the interior of the shape, do not apply to the camera shape.

Return to the overview of Customizing Drawing.

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. The following image displays a camera shape that contains a triangle shape and a cell with text.

Camera Shape with Triange Shape

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)
 

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.
© 2002-2012 ComponentOne, a division of GrapeCity. All Rights Reserved.