Code:
/ DotNET / DotNET / 8.0 / untmp / WIN_WINDOWS / lh_tools_devdiv_wpf / Windows / wcp / Core / 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.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- MemberRelationshipService.cs
- CodeMemberMethod.cs
- ListView.cs
- InfoCardArgumentException.cs
- QilInvoke.cs
- DocComment.cs
- UInt64Converter.cs
- TextBoxView.cs
- BasicExpandProvider.cs
- odbcmetadatacolumnnames.cs
- PostBackOptions.cs
- StringBuilder.cs
- FilterEventArgs.cs
- Select.cs
- FixedSOMTextRun.cs
- IgnoreSectionHandler.cs
- GenericParameterDataContract.cs
- LinqDataSourceStatusEventArgs.cs
- TextParagraph.cs
- StringFormat.cs
- ScrollBar.cs
- XmlWriter.cs
- SizeF.cs
- ThicknessAnimationUsingKeyFrames.cs
- Pkcs7Signer.cs
- Stopwatch.cs
- XmlSchemaSimpleTypeRestriction.cs
- DetailsViewCommandEventArgs.cs
- PolicyVersionConverter.cs
- EntityContainerAssociationSet.cs
- WebConfigurationHostFileChange.cs
- TrustManagerMoreInformation.cs
- DataGridDesigner.cs
- ConnectionStringSettings.cs
- ThreadAbortException.cs
- XslException.cs
- FixedPageProcessor.cs
- ZoomPercentageConverter.cs
- ComponentRenameEvent.cs
- RawStylusInputCustomDataList.cs
- XmlDomTextWriter.cs
- ScrollPatternIdentifiers.cs
- DictionaryTraceRecord.cs
- FileDialog_Vista.cs
- HwndAppCommandInputProvider.cs
- CacheMode.cs
- ReadOnlyPropertyMetadata.cs
- InteropBitmapSource.cs
- MultiByteCodec.cs
- StorageEntitySetMapping.cs
- BackEase.cs
- OdbcFactory.cs
- InvalidComObjectException.cs
- ChtmlTextWriter.cs
- ToolStrip.cs
- BoolExpr.cs
- UriTemplateTable.cs
- RelatedPropertyManager.cs
- Grant.cs
- HtmlShimManager.cs
- ProcessHostFactoryHelper.cs
- ToolStripDropDownMenu.cs
- ContentWrapperAttribute.cs
- VirtualPathExtension.cs
- EntitySqlQueryCacheEntry.cs
- DataGridViewCellToolTipTextNeededEventArgs.cs
- HostingEnvironmentException.cs
- TableRowsCollectionEditor.cs
- PresentationUIStyleResources.cs
- PolyBezierSegmentFigureLogic.cs
- CodeAssignStatement.cs
- DataError.cs
- SmtpMail.cs
- MoveSizeWinEventHandler.cs
- StructuredProperty.cs
- DataProviderNameConverter.cs
- Constant.cs
- TableLayoutSettingsTypeConverter.cs
- InkCanvasInnerCanvas.cs
- ErrorCodes.cs
- IdentityManager.cs
- ExpressionBuilder.cs
- namescope.cs
- ListViewDataItem.cs
- DataServiceHostWrapper.cs
- SQLInt64Storage.cs
- AlignmentYValidation.cs
- OdbcCommand.cs
- DataServiceConfiguration.cs
- FixedDSBuilder.cs
- Query.cs
- RectAnimationBase.cs
- StringUtil.cs
- Matrix.cs
- FormatSelectingMessageInspector.cs
- ReadOnlyMetadataCollection.cs
- VBIdentifierTrimConverter.cs
- CompensationParticipant.cs
- SafeFileMapViewHandle.cs
- Base64Encoding.cs