Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / wpf / src / Core / CSharp / System / Windows / Media / MatrixTransform.cs / 1305600 / MatrixTransform.cs
//------------------------------------------------------------------------------ // Microsoft Avalon // Copyright (c) Microsoft Corporation, 2001 // // File: MatrixTransform.cs //----------------------------------------------------------------------------- using System.Windows.Media; using System; using System.Windows; using System.ComponentModel; using System.ComponentModel.Design.Serialization; using System.Reflection; using System.Security; using System.Security.Permissions; using System.Collections; using MS.Internal; using MS.Internal.PresentationCore; using System.Windows.Media.Animation; using System.Globalization; using System.Text; using System.Runtime.InteropServices; using System.Windows.Media.Composition; using System.Diagnostics; using SR=MS.Internal.PresentationCore.SR; using SRID=MS.Internal.PresentationCore.SRID; namespace System.Windows.Media { ////// Create an arbitrary matrix transformation. /// public sealed partial class MatrixTransform : Transform { #region Constructors ////// /// public MatrixTransform() { } ////// Create an arbitrary matrix transformation. /// ///Matrix value at position 1,1 ///Matrix value at position 1,2 ///Matrix value at position 2,1 ///Matrix value at position 2,2 ///Matrix value at position 3,1 ///Matrix value at position 3,2 public MatrixTransform( double m11, double m12, double m21, double m22, double offsetX, double offsetY ) { Matrix = new Matrix(m11, m12, m21, m22, offsetX, offsetY); } ////// Create a matrix transformation from constant transform. /// ///The constant matrix transformation. public MatrixTransform(Matrix matrix) { Matrix = matrix; } #endregion ////// Return the current transformation value. /// public override Matrix Value { get { ReadPreamble(); return Matrix; } } #region Internal Methods ////// Returns true if transformation matches the identity transform. /// internal override bool IsIdentity { get { return Matrix.IsIdentity && CanFreeze; } } internal override bool CanSerializeToString() { return CanFreeze; } ////// Creates a string representation of this object based on the format string /// and IFormatProvider passed in. /// If the provider is null, the CurrentCulture is used. /// See the documentation for IFormattable for more information. /// ////// A string representation of this object. /// internal override string ConvertToString(string format, IFormatProvider provider) { if (!CanSerializeToString()) { return base.ConvertToString(format, provider); } return ((IFormattable)Matrix).ToString(format, provider); } internal override void TransformRect(ref Rect rect) { Matrix matrix = Matrix; MatrixUtil.TransformRect(ref rect, ref matrix); } internal override void MultiplyValueByMatrix(ref Matrix result, ref Matrix matrixToMultiplyBy) { result = Matrix; MatrixUtil.MultiplyMatrix(ref result, ref matrixToMultiplyBy); } #endregion Internal Methods } } // 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: MatrixTransform.cs //----------------------------------------------------------------------------- using System.Windows.Media; using System; using System.Windows; using System.ComponentModel; using System.ComponentModel.Design.Serialization; using System.Reflection; using System.Security; using System.Security.Permissions; using System.Collections; using MS.Internal; using MS.Internal.PresentationCore; using System.Windows.Media.Animation; using System.Globalization; using System.Text; using System.Runtime.InteropServices; using System.Windows.Media.Composition; using System.Diagnostics; using SR=MS.Internal.PresentationCore.SR; using SRID=MS.Internal.PresentationCore.SRID; namespace System.Windows.Media { ////// Create an arbitrary matrix transformation. /// public sealed partial class MatrixTransform : Transform { #region Constructors ////// /// public MatrixTransform() { } ////// Create an arbitrary matrix transformation. /// ///Matrix value at position 1,1 ///Matrix value at position 1,2 ///Matrix value at position 2,1 ///Matrix value at position 2,2 ///Matrix value at position 3,1 ///Matrix value at position 3,2 public MatrixTransform( double m11, double m12, double m21, double m22, double offsetX, double offsetY ) { Matrix = new Matrix(m11, m12, m21, m22, offsetX, offsetY); } ////// Create a matrix transformation from constant transform. /// ///The constant matrix transformation. public MatrixTransform(Matrix matrix) { Matrix = matrix; } #endregion ////// Return the current transformation value. /// public override Matrix Value { get { ReadPreamble(); return Matrix; } } #region Internal Methods ////// Returns true if transformation matches the identity transform. /// internal override bool IsIdentity { get { return Matrix.IsIdentity && CanFreeze; } } internal override bool CanSerializeToString() { return CanFreeze; } ////// Creates a string representation of this object based on the format string /// and IFormatProvider passed in. /// If the provider is null, the CurrentCulture is used. /// See the documentation for IFormattable for more information. /// ////// A string representation of this object. /// internal override string ConvertToString(string format, IFormatProvider provider) { if (!CanSerializeToString()) { return base.ConvertToString(format, provider); } return ((IFormattable)Matrix).ToString(format, provider); } internal override void TransformRect(ref Rect rect) { Matrix matrix = Matrix; MatrixUtil.TransformRect(ref rect, ref matrix); } internal override void MultiplyValueByMatrix(ref Matrix result, ref Matrix matrixToMultiplyBy) { result = Matrix; MatrixUtil.MultiplyMatrix(ref result, ref matrixToMultiplyBy); } #endregion Internal Methods } } // 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
- CapabilitiesSection.cs
- BindingNavigator.cs
- RuntimeResourceSet.cs
- CollectionViewSource.cs
- MimeFormatter.cs
- EditingCoordinator.cs
- ServiceHostingEnvironment.cs
- HTMLTagNameToTypeMapper.cs
- StatusStrip.cs
- SubpageParagraph.cs
- Exception.cs
- DataTableClearEvent.cs
- Frame.cs
- FixUpCollection.cs
- InvalidDataException.cs
- AnnotationResourceChangedEventArgs.cs
- WebPartMinimizeVerb.cs
- CodeTypeParameterCollection.cs
- ByteStream.cs
- PasswordPropertyTextAttribute.cs
- DataFieldEditor.cs
- Stack.cs
- CompilerScope.cs
- InternalRelationshipCollection.cs
- CompiledQuery.cs
- PerformanceCounterManager.cs
- SqlServices.cs
- NativeMethods.cs
- InsufficientMemoryException.cs
- ToolStripItemEventArgs.cs
- PropertyChangedEventManager.cs
- EntityContainerEntitySet.cs
- DataObject.cs
- StyleModeStack.cs
- DotNetATv1WindowsLogEntryDeserializer.cs
- OdbcConnectionStringbuilder.cs
- DecoderExceptionFallback.cs
- Types.cs
- ProcessThreadDesigner.cs
- EditorPartCollection.cs
- panel.cs
- cookieexception.cs
- Grammar.cs
- ToolStripHighContrastRenderer.cs
- SimpleType.cs
- DataListCommandEventArgs.cs
- Tuple.cs
- ReferenceEqualityComparer.cs
- PrintEvent.cs
- WindowPattern.cs
- GridViewSortEventArgs.cs
- WebServiceReceiveDesigner.cs
- HttpDictionary.cs
- MemberAssignmentAnalysis.cs
- SiteMapHierarchicalDataSourceView.cs
- WindowsScroll.cs
- JsonDataContract.cs
- EntityDataSourceChangedEventArgs.cs
- StructuralType.cs
- ClientScriptManagerWrapper.cs
- SqlEnums.cs
- DbParameterCollection.cs
- OpenTypeLayoutCache.cs
- JavascriptXmlWriterWrapper.cs
- CodeGenerator.cs
- _AcceptOverlappedAsyncResult.cs
- TracedNativeMethods.cs
- ChildTable.cs
- PKCS1MaskGenerationMethod.cs
- URIFormatException.cs
- XmlDigitalSignatureProcessor.cs
- Mouse.cs
- HttpHeaderCollection.cs
- SpecialTypeDataContract.cs
- UIElement3DAutomationPeer.cs
- PopOutPanel.cs
- WorkItem.cs
- Effect.cs
- BooleanFacetDescriptionElement.cs
- Hash.cs
- FormsAuthenticationEventArgs.cs
- validationstate.cs
- WrappedIUnknown.cs
- XmlILTrace.cs
- XPathNode.cs
- TextSelectionHelper.cs
- TransactionChannelListener.cs
- WorkflowServiceAttributes.cs
- ZipPackage.cs
- LinearGradientBrush.cs
- AnnotationResourceCollection.cs
- SystemIcmpV4Statistics.cs
- OracleSqlParser.cs
- Identifier.cs
- AvTrace.cs
- MemberAssignmentAnalysis.cs
- NetCodeGroup.cs
- _ChunkParse.cs
- SourceFilter.cs
- ResourcePool.cs