Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / Orcas / QFE / wpf / src / Core / CSharp / System / Windows / Media / TranslateTransform.cs / 1 / 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
- QuaternionValueSerializer.cs
- NeutralResourcesLanguageAttribute.cs
- PointUtil.cs
- AuthorizationRule.cs
- TransformProviderWrapper.cs
- VisualTreeUtils.cs
- ExpressionVisitor.cs
- MenuCommandService.cs
- StyleXamlParser.cs
- ObjectStateFormatter.cs
- PrincipalPermission.cs
- TemplateBindingExpression.cs
- Exceptions.cs
- Facet.cs
- FileDetails.cs
- TableDetailsCollection.cs
- ProcessThread.cs
- ArcSegment.cs
- WebPartCollection.cs
- PhonemeConverter.cs
- ManualResetEventSlim.cs
- MsmqPoisonMessageException.cs
- WebBrowserSiteBase.cs
- BuildProviderCollection.cs
- WebPartMovingEventArgs.cs
- SimpleType.cs
- CompositeDuplexBindingElement.cs
- FlowDecision.cs
- PagerSettings.cs
- DataGridRelationshipRow.cs
- HostDesigntimeLicenseContext.cs
- EventRouteFactory.cs
- ContextProperty.cs
- RetriableClipboard.cs
- StartFileNameEditor.cs
- PathFigure.cs
- QilValidationVisitor.cs
- GraphicsPathIterator.cs
- NativeDirectoryServicesQueryAPIs.cs
- PenThreadPool.cs
- ImageKeyConverter.cs
- SQLMoneyStorage.cs
- RIPEMD160.cs
- QueueProcessor.cs
- DLinqAssociationProvider.cs
- ListControl.cs
- RowVisual.cs
- SectionVisual.cs
- UnaryNode.cs
- ServiceHostFactory.cs
- ModuleBuilderData.cs
- AppDomainGrammarProxy.cs
- HostedTransportConfigurationManager.cs
- SafeBitVector32.cs
- XPathNode.cs
- loginstatus.cs
- ConstructorNeedsTagAttribute.cs
- Point3DKeyFrameCollection.cs
- Listbox.cs
- RequestNavigateEventArgs.cs
- DataGridPagerStyle.cs
- FixedSOMPageElement.cs
- MaskedTextProvider.cs
- DragCompletedEventArgs.cs
- WebRequest.cs
- MachineSettingsSection.cs
- SqlServices.cs
- CatalogPartChrome.cs
- ToolStripSeparatorRenderEventArgs.cs
- DataGridCell.cs
- HttpPostProtocolImporter.cs
- LocatorPartList.cs
- OptionUsage.cs
- DataGridCommandEventArgs.cs
- Run.cs
- DrawingDrawingContext.cs
- PathSegmentCollection.cs
- ScrollChrome.cs
- InfoCardClaimCollection.cs
- HuffmanTree.cs
- BindingNavigator.cs
- DocumentPaginator.cs
- DataGridViewCellFormattingEventArgs.cs
- AlternateViewCollection.cs
- DocumentViewerAutomationPeer.cs
- SecureConversationVersion.cs
- WebSysDefaultValueAttribute.cs
- RemotingSurrogateSelector.cs
- DrawingVisualDrawingContext.cs
- GacUtil.cs
- DuplexSecurityProtocolFactory.cs
- ReversePositionQuery.cs
- DesignerOptionService.cs
- DataGridViewComboBoxCell.cs
- ValidateNames.cs
- PageAdapter.cs
- DataKeyPropertyAttribute.cs
- DirectionalLight.cs
- RenamedEventArgs.cs
- MetadataItem_Static.cs