Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / Orcas / QFE / wpf / src / Core / CSharp / System / Windows / Media / MatrixTransform.cs / 1 / 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
- XmlReader.cs
- StrongNameMembershipCondition.cs
- ParseHttpDate.cs
- TabPageDesigner.cs
- VisualBrush.cs
- ServicePoint.cs
- ThreadPool.cs
- SwitchLevelAttribute.cs
- MainMenu.cs
- BooleanToVisibilityConverter.cs
- BigInt.cs
- PageCache.cs
- QilReference.cs
- HeaderUtility.cs
- TextViewSelectionProcessor.cs
- PropertySet.cs
- Quad.cs
- DecimalAverageAggregationOperator.cs
- Environment.cs
- SplitterDesigner.cs
- AssociationSetEnd.cs
- MailWebEventProvider.cs
- XmlBaseReader.cs
- Int64AnimationUsingKeyFrames.cs
- GradientStop.cs
- SqlInternalConnectionTds.cs
- TimeSpanParse.cs
- EditorPart.cs
- IDispatchConstantAttribute.cs
- ListViewItemMouseHoverEvent.cs
- SqlUtils.cs
- EventProxy.cs
- OverflowException.cs
- CodeAttributeDeclarationCollection.cs
- Rule.cs
- MultilineStringConverter.cs
- HtmlWindowCollection.cs
- TypeInfo.cs
- GradientBrush.cs
- TextEditorTables.cs
- DataTransferEventArgs.cs
- WebSysDefaultValueAttribute.cs
- CultureSpecificCharacterBufferRange.cs
- SizeKeyFrameCollection.cs
- PeerNameRecord.cs
- DisposableCollectionWrapper.cs
- metadatamappinghashervisitor.hashsourcebuilder.cs
- Int32Collection.cs
- FindCriteriaApril2005.cs
- WriteLineDesigner.xaml.cs
- PeerNodeAddress.cs
- CodeIterationStatement.cs
- SqlDataSourceEnumerator.cs
- XmlChoiceIdentifierAttribute.cs
- SessionStateItemCollection.cs
- WindowsIdentity.cs
- LinqDataSourceValidationException.cs
- CommandDevice.cs
- ImageFormat.cs
- DecimalConverter.cs
- GenericEnumerator.cs
- WebPart.cs
- CasesDictionary.cs
- SmtpSection.cs
- DmlSqlGenerator.cs
- AttachedPropertyMethodSelector.cs
- RenderOptions.cs
- ErrorWebPart.cs
- PersianCalendar.cs
- SqlDataReaderSmi.cs
- Mapping.cs
- StateItem.cs
- DrawingDrawingContext.cs
- BamlLocalizer.cs
- Misc.cs
- SqlMetaData.cs
- MemoryRecordBuffer.cs
- LoginName.cs
- Error.cs
- DurableMessageDispatchInspector.cs
- StringResourceManager.cs
- MetadataArtifactLoader.cs
- ForEachAction.cs
- DocumentPage.cs
- Merger.cs
- StringCollection.cs
- CallbackValidator.cs
- TemplateControl.cs
- LOSFormatter.cs
- ChtmlCalendarAdapter.cs
- ListBase.cs
- SQLInt32.cs
- UserControlParser.cs
- OperationParameterInfoCollection.cs
- ClientType.cs
- CssStyleCollection.cs
- IDReferencePropertyAttribute.cs
- PageHandlerFactory.cs
- InteropBitmapSource.cs
- Substitution.cs