C# Class Smrf.NodeXL.Visualization.Wpf.NodeXLControl.GraphImageCenterer

Centers a graph image for the NodeXLControl and later restores the original graph location.
This prepares the NodeXLControl for being saved as an image. It adjusts the control's transforms so that the image will be centered on the same point on the graph that the control is centered on. This prevents an unwanted graph shift when the image has dimensions different from those of the control.

Because the NodeXLControl's transforms are not public, this class is embedded within the control.

Pass an image size to CenterGraphImage, which immediately centers the graph within the image dimensions. Call to restore the graph to its original location.

Inheritance: Object
Mostrar archivo Open project: 2014-sed-team3/term-project Class Usage Examples

Protected Properties

Property Type Description
m_dOriginalScaleTransformForRenderCenterX Double
m_dOriginalScaleTransformForRenderCenterY Double
m_dOriginalTranslateTransformForRenderX Double
m_dOriginalTranslateTransformForRenderY Double
m_oNodeXLControl NodeXLControl

Public Methods

Method Description
CenterGraphImage ( Size imageSize ) : void
GraphImageCenterer ( NodeXLControl nodeXLControl ) : System

Initializes a new instance of the GraphImageCenterer class.

RestoreCenter ( ) : void

Private Methods

Method Description
AssertValid ( ) : void

Method Details

CenterGraphImage() public method

public CenterGraphImage ( Size imageSize ) : void
imageSize System.Windows.Size
return void

GraphImageCenterer() public method

Initializes a new instance of the GraphImageCenterer class.
public GraphImageCenterer ( NodeXLControl nodeXLControl ) : System
nodeXLControl NodeXLControl /// The control for which a graph image will be created. ///
return System

RestoreCenter() public method

public RestoreCenter ( ) : void
return void

Property Details

m_dOriginalScaleTransformForRenderCenterX protected_oe property

protected Double m_dOriginalScaleTransformForRenderCenterX
return Double

m_dOriginalScaleTransformForRenderCenterY protected_oe property

protected Double m_dOriginalScaleTransformForRenderCenterY
return Double

m_dOriginalTranslateTransformForRenderX protected_oe property

protected Double m_dOriginalTranslateTransformForRenderX
return Double

m_dOriginalTranslateTransformForRenderY protected_oe property

protected Double m_dOriginalTranslateTransformForRenderY
return Double

m_oNodeXLControl protected_oe property

protected NodeXLControl,Smrf.NodeXL.Visualization.Wpf m_oNodeXLControl
return NodeXLControl