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
- AutomationPeer.cs
- ErrorProvider.cs
- PopupEventArgs.cs
- HtmlLink.cs
- ToolStripDropDown.cs
- BCryptHashAlgorithm.cs
- Function.cs
- OletxDependentTransaction.cs
- TextChangedEventArgs.cs
- SelfIssuedSamlTokenFactory.cs
- CultureInfo.cs
- StorageEndPropertyMapping.cs
- control.ime.cs
- ScriptReferenceBase.cs
- GridEntryCollection.cs
- IInstanceTable.cs
- ObjectDisposedException.cs
- ExtensionSurface.cs
- AuthenticationModuleElementCollection.cs
- MergeFilterQuery.cs
- RedirectionProxy.cs
- PhoneCall.cs
- SignatureDescription.cs
- TextCompositionManager.cs
- BrowserTree.cs
- ServiceErrorHandler.cs
- ToolStripSplitStackLayout.cs
- PolicyLevel.cs
- StringUtil.cs
- RenderOptions.cs
- StringResourceManager.cs
- HandlerMappingMemo.cs
- _Events.cs
- WSDualHttpSecurityMode.cs
- FlowLayout.cs
- sqlser.cs
- XmlElementAttribute.cs
- input.cs
- RepeaterCommandEventArgs.cs
- HttpCachePolicy.cs
- StackBuilderSink.cs
- BlurBitmapEffect.cs
- XslNumber.cs
- BitmapDownload.cs
- TemplateControl.cs
- DataGridViewCellStyle.cs
- EncoderExceptionFallback.cs
- Repeater.cs
- ItemsControlAutomationPeer.cs
- complextypematerializer.cs
- UriParserTemplates.cs
- ContextMenuService.cs
- FontStretchConverter.cs
- BaseHashHelper.cs
- Polygon.cs
- WindowsBrush.cs
- WSSecurityPolicy12.cs
- QilExpression.cs
- PersistenceParticipant.cs
- MobileDeviceCapabilitiesSectionHandler.cs
- PolyLineSegment.cs
- SortedSet.cs
- DataGridColumnCollection.cs
- BufferAllocator.cs
- ValidationErrorEventArgs.cs
- SByte.cs
- Graphics.cs
- NameSpaceExtractor.cs
- TextChangedEventArgs.cs
- LinkedList.cs
- ByteConverter.cs
- ConstraintStruct.cs
- FilteredReadOnlyMetadataCollection.cs
- XmlSchemaSimpleContent.cs
- Speller.cs
- DataTableMappingCollection.cs
- EmulateRecognizeCompletedEventArgs.cs
- DynamicActivityXamlReader.cs
- CharacterString.cs
- TcpTransportManager.cs
- TypeUsage.cs
- MULTI_QI.cs
- SerializableAttribute.cs
- CodeExpressionCollection.cs
- LocatorBase.cs
- DbCommandDefinition.cs
- LockCookie.cs
- ListDesigner.cs
- DefaultTextStoreTextComposition.cs
- Models.cs
- Panel.cs
- MediaSystem.cs
- ManipulationDelta.cs
- ActivitySurrogate.cs
- ConfigurationValues.cs
- HttpAsyncResult.cs
- GlobalItem.cs
- DesignerAutoFormatCollection.cs
- SimpleTextLine.cs
- ProxyWebPartManager.cs