Code:
/ 4.0 / 4.0 / untmp / 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.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- PixelFormats.cs
- GlyphsSerializer.cs
- InstanceKey.cs
- ProgressPage.cs
- ViewKeyConstraint.cs
- EventLogEntryCollection.cs
- Visual.cs
- RadioButtonRenderer.cs
- StylusShape.cs
- CodeDomLocalizationProvider.cs
- XNameTypeConverter.cs
- Line.cs
- XsdDateTime.cs
- ConfigXmlReader.cs
- FunctionUpdateCommand.cs
- MimeBasePart.cs
- DesignerValidationSummaryAdapter.cs
- _emptywebproxy.cs
- EncryptedPackage.cs
- ReferencedCategoriesDocument.cs
- SerializationSectionGroup.cs
- SqlUnionizer.cs
- TextTreeRootNode.cs
- PnrpPeerResolverElement.cs
- ConnectorEditor.cs
- TemplateGroupCollection.cs
- UpWmlPageAdapter.cs
- ThreadAbortException.cs
- SecureStringHasher.cs
- PropertyGridEditorPart.cs
- CodeMemberProperty.cs
- UrlRoutingModule.cs
- ClientUtils.cs
- ContentDisposition.cs
- processwaithandle.cs
- WriterOutput.cs
- ClientUrlResolverWrapper.cs
- COM2PictureConverter.cs
- WindowsSecurityToken.cs
- DocumentViewerBase.cs
- Deserializer.cs
- ComponentResourceKeyConverter.cs
- TypedRowHandler.cs
- BrowsableAttribute.cs
- ComboBoxAutomationPeer.cs
- ResourceCategoryAttribute.cs
- DateTimeOffsetStorage.cs
- ProxyWebPart.cs
- TabControlCancelEvent.cs
- InnerItemCollectionView.cs
- TypeConverterHelper.cs
- Serializer.cs
- DataGridPageChangedEventArgs.cs
- WindowsGraphics2.cs
- DateTimeOffsetStorage.cs
- DelegatingTypeDescriptionProvider.cs
- ComponentCommands.cs
- WindowHideOrCloseTracker.cs
- ApplicationInfo.cs
- TypeContext.cs
- ResXBuildProvider.cs
- SmtpFailedRecipientsException.cs
- ConstructorExpr.cs
- HotSpotCollectionEditor.cs
- RadioButton.cs
- CodeCommentStatement.cs
- DataStorage.cs
- ProtocolsConfiguration.cs
- ConfigUtil.cs
- DynamicValidatorEventArgs.cs
- PrintDocument.cs
- IImplicitResourceProvider.cs
- SoapObjectInfo.cs
- RelationshipEndCollection.cs
- MessageQueueConverter.cs
- TreeViewItem.cs
- IdentityHolder.cs
- ListViewDesigner.cs
- FamilyTypefaceCollection.cs
- DataProtection.cs
- HtmlInputReset.cs
- XDeferredAxisSource.cs
- ButtonBase.cs
- SmiRecordBuffer.cs
- GridViewCancelEditEventArgs.cs
- BitmapMetadataBlob.cs
- HttpApplication.cs
- SchemaEntity.cs
- HwndSource.cs
- CustomSignedXml.cs
- ReflectionPermission.cs
- MissingManifestResourceException.cs
- TabRenderer.cs
- printdlgexmarshaler.cs
- HttpDebugHandler.cs
- SerializerDescriptor.cs
- SecurityPolicySection.cs
- EditorPart.cs
- SafeFindHandle.cs
- FactoryMaker.cs