Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / Orcas / NetFXw7 / 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
- AudioLevelUpdatedEventArgs.cs
- AddIn.cs
- ItemTypeToolStripMenuItem.cs
- PageThemeCodeDomTreeGenerator.cs
- XmlDigitalSignatureProcessor.cs
- PipelineModuleStepContainer.cs
- SafePEFileHandle.cs
- unsafenativemethodsother.cs
- XmlTextReaderImplHelpers.cs
- XmlDocumentSurrogate.cs
- serverconfig.cs
- ModulesEntry.cs
- _HeaderInfo.cs
- ProxyWebPartConnectionCollection.cs
- ObjectItemNoOpAssemblyLoader.cs
- XmlILStorageConverter.cs
- SiteMapDataSource.cs
- CorePropertiesFilter.cs
- IDQuery.cs
- EffectiveValueEntry.cs
- DuplexClientBase.cs
- TriggerActionCollection.cs
- ObservableCollection.cs
- XmlElementList.cs
- AttributeUsageAttribute.cs
- DispatcherEventArgs.cs
- GcHandle.cs
- ColumnHeader.cs
- ReadOnlyDictionary.cs
- SelectingProviderEventArgs.cs
- ContentElement.cs
- TargetParameterCountException.cs
- ProgressiveCrcCalculatingStream.cs
- DataGridViewBand.cs
- SupportingTokenChannel.cs
- AssemblyBuilder.cs
- Hash.cs
- UpdatePanel.cs
- returneventsaver.cs
- GenericWebPart.cs
- FileStream.cs
- ExtensionWindowHeader.cs
- CopyCodeAction.cs
- COM2EnumConverter.cs
- TemplateField.cs
- ScopelessEnumAttribute.cs
- ExpressionVisitorHelpers.cs
- printdlgexmarshaler.cs
- RepeatBehaviorConverter.cs
- SerializationHelper.cs
- OperationResponse.cs
- SQlBooleanStorage.cs
- SynchronizedChannelCollection.cs
- ColumnProvider.cs
- BindingMAnagerBase.cs
- DataControlFieldHeaderCell.cs
- CleanUpVirtualizedItemEventArgs.cs
- controlskin.cs
- PrimitiveCodeDomSerializer.cs
- HttpResponse.cs
- Command.cs
- ReverseInheritProperty.cs
- ContentType.cs
- OracleCommand.cs
- PolicyManager.cs
- ZipIOLocalFileHeader.cs
- CursorConverter.cs
- ParameterCollection.cs
- ServicePoint.cs
- XmlSchemaSimpleContentExtension.cs
- BaseTemplateBuildProvider.cs
- HostExecutionContextManager.cs
- RootBrowserWindowAutomationPeer.cs
- HttpCookiesSection.cs
- TemplateControl.cs
- ListBase.cs
- ImageAttributes.cs
- Help.cs
- WebPartsPersonalization.cs
- SiteMapHierarchicalDataSourceView.cs
- Tuple.cs
- ConnectionPointCookie.cs
- SignerInfo.cs
- DropShadowBitmapEffect.cs
- Attributes.cs
- EntityDataSourceValidationException.cs
- RoleGroupCollection.cs
- ExpressionEditorAttribute.cs
- ContravarianceAdapter.cs
- RandomDelayQueuedSendsAsyncResult.cs
- LabelEditEvent.cs
- Propagator.Evaluator.cs
- EntityCommandCompilationException.cs
- ModelItem.cs
- QuaternionAnimationBase.cs
- AmbientLight.cs
- ParamArrayAttribute.cs
- OdbcDataReader.cs
- TwoPhaseCommit.cs
- NCryptNative.cs