Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / Orcas / NetFXw7 / 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
- BmpBitmapEncoder.cs
- WinInetCache.cs
- RowType.cs
- ApplicationCommands.cs
- RawStylusActions.cs
- LocationReferenceEnvironment.cs
- NameValueConfigurationElement.cs
- PlanCompiler.cs
- ViewStateModeByIdAttribute.cs
- HtmlTextViewAdapter.cs
- ApplicationDirectoryMembershipCondition.cs
- ElementHost.cs
- HeaderedItemsControl.cs
- RtfControls.cs
- ServiceModelDictionary.cs
- MaterializeFromAtom.cs
- LoadedOrUnloadedOperation.cs
- transactioncontext.cs
- WorkflowRuntimeSection.cs
- SemanticAnalyzer.cs
- Fonts.cs
- PeerNearMe.cs
- ConnectionStringSettingsCollection.cs
- SqlTypesSchemaImporter.cs
- ToolStripContentPanelRenderEventArgs.cs
- InternalsVisibleToAttribute.cs
- XPathNodeList.cs
- FontClient.cs
- ErrorInfoXmlDocument.cs
- XComponentModel.cs
- ScriptResourceInfo.cs
- InkCanvasInnerCanvas.cs
- printdlgexmarshaler.cs
- SourceFileBuildProvider.cs
- SchemaNames.cs
- InvariantComparer.cs
- RelationshipEndMember.cs
- DateTimeUtil.cs
- SchemaInfo.cs
- CodeTryCatchFinallyStatement.cs
- ActivityTrace.cs
- SimpleWebHandlerParser.cs
- EditorPartChrome.cs
- GridViewRowEventArgs.cs
- CompilationLock.cs
- ManagedIStream.cs
- WsatTransactionInfo.cs
- SearchForVirtualItemEventArgs.cs
- _TLSstream.cs
- AllMembershipCondition.cs
- XmlTextReader.cs
- EventDescriptorCollection.cs
- PngBitmapDecoder.cs
- ExpressionEditorAttribute.cs
- NetworkCredential.cs
- BezierSegment.cs
- ObjectViewQueryResultData.cs
- ObjectHelper.cs
- TemplateField.cs
- RoleServiceManager.cs
- CodeTypeReference.cs
- ModuleBuilderData.cs
- CodeCastExpression.cs
- TextDecorationLocationValidation.cs
- ZipIOModeEnforcingStream.cs
- ToolStripDropTargetManager.cs
- EventWaitHandleSecurity.cs
- XamlPoint3DCollectionSerializer.cs
- StackOverflowException.cs
- __Filters.cs
- KnownColorTable.cs
- TextShapeableCharacters.cs
- ListenerElementsCollection.cs
- ConstructorArgumentAttribute.cs
- XmlBinaryReader.cs
- SelectionUIHandler.cs
- WebAdminConfigurationHelper.cs
- AsyncSerializedWorker.cs
- TrustManagerPromptUI.cs
- OrthographicCamera.cs
- XPathNodeList.cs
- LinqMaximalSubtreeNominator.cs
- CharKeyFrameCollection.cs
- ToolStripLocationCancelEventArgs.cs
- ZeroOpNode.cs
- RecipientInfo.cs
- EncoderNLS.cs
- UserNameSecurityTokenProvider.cs
- ServiceAuthorizationElement.cs
- SplitterPanel.cs
- DataListItem.cs
- HelpInfo.cs
- BamlBinaryReader.cs
- Restrictions.cs
- WebPageTraceListener.cs
- AppDomainFactory.cs
- AnimationClock.cs
- ColorConvertedBitmap.cs
- DataSourceHelper.cs
- FastEncoderStatics.cs