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
- FormsAuthenticationUser.cs
- formatter.cs
- CommandID.cs
- EnumDataContract.cs
- NameValueSectionHandler.cs
- _PooledStream.cs
- BaseCAMarshaler.cs
- DoubleConverter.cs
- OperandQuery.cs
- ResourceDescriptionAttribute.cs
- MetadataUtil.cs
- WorkerRequest.cs
- XmlSchemaProviderAttribute.cs
- ProcessHostConfigUtils.cs
- FormViewCommandEventArgs.cs
- Camera.cs
- WebPartManager.cs
- ListViewCancelEventArgs.cs
- DelayedRegex.cs
- Message.cs
- XmlSchemaFacet.cs
- DbConnectionPoolIdentity.cs
- WaitForChangedResult.cs
- PartialTrustVisibleAssembliesSection.cs
- X509ThumbprintKeyIdentifierClause.cs
- TrackingProfileManager.cs
- ValueQuery.cs
- JobDuplex.cs
- TickBar.cs
- DiscoveryMessageSequenceCD1.cs
- AvTraceFormat.cs
- DecimalFormatter.cs
- PrivateFontCollection.cs
- MeshGeometry3D.cs
- ScriptServiceAttribute.cs
- UrlPath.cs
- GroupQuery.cs
- OleDbConnection.cs
- Figure.cs
- PageContentAsyncResult.cs
- FigureParaClient.cs
- VideoDrawing.cs
- TemplateLookupAction.cs
- ClientUtils.cs
- DataBindingHandlerAttribute.cs
- PerspectiveCamera.cs
- XamlInt32CollectionSerializer.cs
- SqlBuilder.cs
- Table.cs
- HelpProvider.cs
- StrongNameMembershipCondition.cs
- DataSetUtil.cs
- QilScopedVisitor.cs
- figurelengthconverter.cs
- FilterQuery.cs
- DataGridHyperlinkColumn.cs
- WindowsFont.cs
- UInt16Converter.cs
- BindingNavigatorDesigner.cs
- QueueProcessor.cs
- AssociationType.cs
- JsonReaderWriterFactory.cs
- SqlUserDefinedTypeAttribute.cs
- WebBrowser.cs
- FontSizeConverter.cs
- Border.cs
- ConfigurationStrings.cs
- WmfPlaceableFileHeader.cs
- WindowsIPAddress.cs
- SubpageParagraph.cs
- DataSpaceManager.cs
- FileRegion.cs
- DataGridViewLayoutData.cs
- DataGridState.cs
- URLMembershipCondition.cs
- RedistVersionInfo.cs
- RequestResizeEvent.cs
- EndGetFileNameFromUserRequest.cs
- MailDefinition.cs
- FileAuthorizationModule.cs
- URIFormatException.cs
- XamlStyleSerializer.cs
- TransformerTypeCollection.cs
- RequestStatusBarUpdateEventArgs.cs
- EntityKey.cs
- TreeNodeCollection.cs
- MobileListItem.cs
- HttpCapabilitiesEvaluator.cs
- DataServiceProviderMethods.cs
- CqlGenerator.cs
- AdornerHitTestResult.cs
- BinaryParser.cs
- StylusButton.cs
- DynamicDocumentPaginator.cs
- LeftCellWrapper.cs
- AuthenticationService.cs
- WCFServiceClientProxyGenerator.cs
- GACMembershipCondition.cs
- RadioButtonDesigner.cs
- CallTemplateAction.cs