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
- XmlDocumentFieldSchema.cs
- Timeline.cs
- MetadataCache.cs
- DataGridPagerStyle.cs
- BinaryUtilClasses.cs
- HttpRuntimeSection.cs
- x509store.cs
- DecoderFallbackWithFailureFlag.cs
- RenderOptions.cs
- PropertyValueUIItem.cs
- COM2EnumConverter.cs
- WorkflowExecutor.cs
- TiffBitmapEncoder.cs
- SizeConverter.cs
- TextTreeTextElementNode.cs
- KeyboardEventArgs.cs
- PartitionedStream.cs
- ListChangedEventArgs.cs
- TableProviderWrapper.cs
- EditorPart.cs
- BamlStream.cs
- TextEffect.cs
- MsmqEncryptionAlgorithm.cs
- TableAutomationPeer.cs
- DataGridViewSelectedRowCollection.cs
- String.cs
- WpfWebRequestHelper.cs
- DefaultObjectMappingItemCollection.cs
- TransformProviderWrapper.cs
- ArgumentElement.cs
- WeakReferenceList.cs
- FormattedTextSymbols.cs
- CalendarButtonAutomationPeer.cs
- ContextProperty.cs
- HeaderLabel.cs
- DeferredElementTreeState.cs
- TimersDescriptionAttribute.cs
- ToolboxItem.cs
- Task.cs
- SelectedDatesCollection.cs
- CustomErrorCollection.cs
- ProcessManager.cs
- _FtpDataStream.cs
- TextContainerChangeEventArgs.cs
- RenderTargetBitmap.cs
- iisPickupDirectory.cs
- EntityStoreSchemaGenerator.cs
- SQLByteStorage.cs
- DocumentApplication.cs
- XamlStream.cs
- WebPartCloseVerb.cs
- WpfGeneratedKnownTypes.cs
- XmlNotation.cs
- RowToFieldTransformer.cs
- TransformerInfoCollection.cs
- ResourceManager.cs
- ApplicationManager.cs
- SystemGatewayIPAddressInformation.cs
- MissingFieldException.cs
- TemplateField.cs
- Point3D.cs
- WebPartTransformerAttribute.cs
- ServiceModelConfigurationSectionGroup.cs
- TransformerInfo.cs
- ServiceDescriptionData.cs
- StrokeNodeOperations2.cs
- RootBuilder.cs
- HelpProvider.cs
- DataGridColumn.cs
- CorrelationKey.cs
- DrawingVisualDrawingContext.cs
- followingquery.cs
- TaiwanLunisolarCalendar.cs
- StyleModeStack.cs
- PerformanceCounterCategory.cs
- GeometryConverter.cs
- OracleInfoMessageEventArgs.cs
- PackWebRequestFactory.cs
- FontSizeConverter.cs
- SystemIPGlobalStatistics.cs
- StringCollection.cs
- HMACSHA1.cs
- ResourceExpressionBuilder.cs
- ProfilePropertyNameValidator.cs
- HelloOperationAsyncResult.cs
- MaterialGroup.cs
- glyphs.cs
- DataGridCellEditEndingEventArgs.cs
- DrawListViewColumnHeaderEventArgs.cs
- DropDownList.cs
- AuthenticationModeHelper.cs
- SamlAttributeStatement.cs
- WindowsContainer.cs
- BasePropertyDescriptor.cs
- MemberRestriction.cs
- WebScriptMetadataFormatter.cs
- Bits.cs
- CapabilitiesAssignment.cs
- FontFaceLayoutInfo.cs
- EmptyCollection.cs