Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / wpf / src / Core / CSharp / System / Windows / Media / TranslateTransform.cs / 1305600 / TranslateTransform.cs
//------------------------------------------------------------------------------ // Microsoft Avalon // Copyright (c) Microsoft Corporation, 2001 // // File: TranslateTransform.cs //----------------------------------------------------------------------------- using MS.Internal; using MS.Internal.PresentationCore; using System; using System.Collections; using System.ComponentModel; using System.ComponentModel.Design.Serialization; using System.Diagnostics; using System.Globalization; using System.Reflection; using System.Runtime.InteropServices; using System.Security; using System.Text; using System.Windows; using System.Windows.Media; using System.Windows.Media.Animation; using System.Windows.Media.Composition; using SR=MS.Internal.PresentationCore.SR; using SRID=MS.Internal.PresentationCore.SRID; namespace System.Windows.Media { #region TranslateTransform ////// Create a translation transformation. /// public sealed partial class TranslateTransform : Transform { ////// /// public TranslateTransform() { } ////// Create a translation transformation. /// ///Displacement amount in x direction. ///Displacement amount in y direction. public TranslateTransform( double offsetX, double offsetY ) { X = offsetX; Y = offsetY; } ////// Return the current transformation value. /// public override Matrix Value { get { ReadPreamble(); Matrix matrix = Matrix.Identity; matrix.Translate(X, Y); return matrix; } } ////// Returns true if transformation matches the identity transform. /// internal override bool IsIdentity { get { return X == 0 && Y == 0 && CanFreeze; } } #region Internal Methods internal override void TransformRect(ref Rect rect) { if (!rect.IsEmpty) { rect.Offset(X, Y); } } ////// MultiplyValueByMatrix - result is set equal to "this" * matrixToMultiplyBy. /// /// The result is stored here. /// The multiplicand. internal override void MultiplyValueByMatrix(ref Matrix result, ref Matrix matrixToMultiplyBy) { result = Matrix.Identity; // Set the translate + type result._offsetX = X; result._offsetY = Y; result._type = MatrixTypes.TRANSFORM_IS_TRANSLATION; MatrixUtil.MultiplyMatrix(ref result, ref matrixToMultiplyBy); } #endregion Internal Methods } #endregion } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved. //------------------------------------------------------------------------------ // Microsoft Avalon // Copyright (c) Microsoft Corporation, 2001 // // File: TranslateTransform.cs //----------------------------------------------------------------------------- using MS.Internal; using MS.Internal.PresentationCore; using System; using System.Collections; using System.ComponentModel; using System.ComponentModel.Design.Serialization; using System.Diagnostics; using System.Globalization; using System.Reflection; using System.Runtime.InteropServices; using System.Security; using System.Text; using System.Windows; using System.Windows.Media; using System.Windows.Media.Animation; using System.Windows.Media.Composition; using SR=MS.Internal.PresentationCore.SR; using SRID=MS.Internal.PresentationCore.SRID; namespace System.Windows.Media { #region TranslateTransform ////// Create a translation transformation. /// public sealed partial class TranslateTransform : Transform { ////// /// public TranslateTransform() { } ////// Create a translation transformation. /// ///Displacement amount in x direction. ///Displacement amount in y direction. public TranslateTransform( double offsetX, double offsetY ) { X = offsetX; Y = offsetY; } ////// Return the current transformation value. /// public override Matrix Value { get { ReadPreamble(); Matrix matrix = Matrix.Identity; matrix.Translate(X, Y); return matrix; } } ////// Returns true if transformation matches the identity transform. /// internal override bool IsIdentity { get { return X == 0 && Y == 0 && CanFreeze; } } #region Internal Methods internal override void TransformRect(ref Rect rect) { if (!rect.IsEmpty) { rect.Offset(X, Y); } } ////// MultiplyValueByMatrix - result is set equal to "this" * matrixToMultiplyBy. /// /// The result is stored here. /// The multiplicand. internal override void MultiplyValueByMatrix(ref Matrix result, ref Matrix matrixToMultiplyBy) { result = Matrix.Identity; // Set the translate + type result._offsetX = X; result._offsetY = Y; result._type = MatrixTypes.TRANSFORM_IS_TRANSLATION; MatrixUtil.MultiplyMatrix(ref result, ref matrixToMultiplyBy); } #endregion Internal Methods } #endregion } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- FigureParagraph.cs
- FileNotFoundException.cs
- COM2PictureConverter.cs
- FastEncoder.cs
- WindowsGraphics.cs
- HideDisabledControlAdapter.cs
- WriterOutput.cs
- Matrix.cs
- TextTrailingWordEllipsis.cs
- Image.cs
- _AutoWebProxyScriptEngine.cs
- _RequestCacheProtocol.cs
- MouseActionConverter.cs
- XmlNode.cs
- XPathNodeList.cs
- StandardBindingReliableSessionElement.cs
- DigestComparer.cs
- XmlNodeChangedEventArgs.cs
- SpecularMaterial.cs
- MenuCommands.cs
- BatchParser.cs
- DocumentPageViewAutomationPeer.cs
- NameValueConfigurationCollection.cs
- TextElementEnumerator.cs
- Baml6Assembly.cs
- TextServicesHost.cs
- LocalizedNameDescriptionPair.cs
- CqlErrorHelper.cs
- InvalidCommandTreeException.cs
- HandledEventArgs.cs
- WebServiceTypeData.cs
- PropertyPushdownHelper.cs
- IdentifierService.cs
- DataGridCellsPanel.cs
- FacetValueContainer.cs
- TextPatternIdentifiers.cs
- ResourceManagerWrapper.cs
- AdCreatedEventArgs.cs
- EncoderParameters.cs
- ValidationErrorEventArgs.cs
- CompilerCollection.cs
- ParsedAttributeCollection.cs
- MenuCommand.cs
- EntityAdapter.cs
- Symbol.cs
- CaseInsensitiveHashCodeProvider.cs
- ListenerElementsCollection.cs
- ReadOnlyPropertyMetadata.cs
- DataGridViewSelectedCellCollection.cs
- remotingproxy.cs
- MarshalByRefObject.cs
- MessageQueueEnumerator.cs
- WmlValidationSummaryAdapter.cs
- WebPartTracker.cs
- SpellerError.cs
- Ref.cs
- SafeThreadHandle.cs
- CachedRequestParams.cs
- Walker.cs
- ListViewUpdatedEventArgs.cs
- CharAnimationBase.cs
- ParameterInfo.cs
- WindowVisualStateTracker.cs
- SqlMethods.cs
- SoapSchemaExporter.cs
- DirectionalLight.cs
- QuaternionRotation3D.cs
- ProjectionQueryOptionExpression.cs
- WsiProfilesElement.cs
- GridViewColumnCollection.cs
- Base64Decoder.cs
- ColorPalette.cs
- PanelDesigner.cs
- MasterPageParser.cs
- SoapSchemaMember.cs
- IPipelineRuntime.cs
- Win32PrintDialog.cs
- ImageCodecInfoPrivate.cs
- ControlFilterExpression.cs
- ClientUrlResolverWrapper.cs
- TreeViewDesigner.cs
- TreeIterators.cs
- x509store.cs
- RegistryConfigurationProvider.cs
- SelectionPatternIdentifiers.cs
- ConfigurationManagerHelper.cs
- OdbcParameter.cs
- FieldAccessException.cs
- GridViewDeletedEventArgs.cs
- TdsRecordBufferSetter.cs
- ZipPackage.cs
- AtomMaterializerLog.cs
- XPathDocumentBuilder.cs
- _ConnectionGroup.cs
- XmlDataSource.cs
- Number.cs
- Perspective.cs
- FlowLayoutSettings.cs
- MultiByteCodec.cs
- CalendarSelectionChangedEventArgs.cs